:root { --gtgs-color: #2A9D8F; }

#gtgs-root, #gtgs-root * { box-sizing: border-box; }
#gtgs-root {
  position: fixed; right: 20px; bottom: 20px; z-index: 99999;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px; line-height: 1.45; color: #1f2933;
}

/* Launcher */
#gtgs-launcher {
  width: 60px; height: 60px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--gtgs-color); color: #fff; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 20px rgba(0,0,0,.25); transition: transform .15s ease;
}
#gtgs-launcher:hover { transform: scale(1.06); }
#gtgs-launcher:focus-visible, #gtgs-send:focus-visible, #gtgs-close:focus-visible, .gtgs-chip:focus-visible, #gtgs-bubble-x:focus-visible {
  outline: 3px solid rgba(0,0,0,.35); outline-offset: 2px;
}
#gtgs-launcher svg { width: 28px; height: 28px; fill: currentColor; }

/* Greeting bubble (does not open the chat) */
#gtgs-bubble {
  position: absolute; right: 70px; bottom: 8px; max-width: 230px;
  background: #fff; color: #1f2933; border-radius: 14px; padding: 12px 34px 12px 14px;
  box-shadow: 0 6px 24px rgba(0,0,0,.18); cursor: pointer;
  opacity: 0; transform: translateY(8px) scale(.96); pointer-events: none;
  transition: opacity .3s ease, transform .3s ease;
}
#gtgs-bubble.gtgs-show { opacity: 1; transform: none; pointer-events: auto; }
#gtgs-bubble::after {
  content: ""; position: absolute; right: -6px; bottom: 18px; width: 12px; height: 12px;
  background: #fff; transform: rotate(45deg); border-radius: 2px;
}
#gtgs-bubble-x {
  position: absolute; top: 4px; right: 6px; width: 24px; height: 24px; border: 0; background: transparent;
  color: #7b8794; font-size: 18px; line-height: 1; cursor: pointer; border-radius: 50%;
}
#gtgs-bubble-x:hover { color: #1f2933; background: #f0f2f4; }

/* Panel */
#gtgs-panel {
  position: absolute; right: 0; bottom: 76px; width: 370px; max-width: calc(100vw - 24px);
  height: 540px; max-height: calc(100vh - 110px);
  background: #fff; border-radius: 16px; overflow: hidden; display: none; flex-direction: column;
  box-shadow: 0 12px 40px rgba(0,0,0,.28);
}
#gtgs-panel.gtgs-open { display: flex; animation: gtgs-pop .2s ease; }
@keyframes gtgs-pop { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

#gtgs-head { background: var(--gtgs-color); color: #fff; padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; }
#gtgs-title { font-weight: 700; font-size: 16px; }
#gtgs-sub { font-size: 12px; opacity: .9; }
#gtgs-close { background: transparent; border: 0; color: #fff; font-size: 24px; line-height: 1; cursor: pointer; padding: 4px 8px; border-radius: 6px; }
#gtgs-close:hover { background: rgba(255,255,255,.18); }

#gtgs-log { flex: 1; overflow-y: auto; padding: 14px; background: #f6f8f9; display: flex; flex-direction: column; gap: 10px; }
.gtgs-msg { max-width: 86%; padding: 10px 13px; border-radius: 14px; white-space: pre-wrap; word-wrap: break-word; overflow-wrap: anywhere; }
.gtgs-bot { background: #fff; border: 1px solid #e3e8ec; align-self: flex-start; border-bottom-left-radius: 4px; }
.gtgs-user { background: var(--gtgs-color); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.gtgs-msg a { color: inherit; text-decoration: underline; font-weight: 600; }
.gtgs-bot a { color: var(--gtgs-color); }

.gtgs-typing { display: inline-flex; gap: 4px; align-items: center; }
.gtgs-typing i { width: 7px; height: 7px; border-radius: 50%; background: #9aa5b1; animation: gtgs-b 1.2s infinite; }
.gtgs-typing i:nth-child(2) { animation-delay: .15s; }
.gtgs-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes gtgs-b { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-4px); opacity: 1; } }

#gtgs-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px 10px; background: #f6f8f9; }
.gtgs-chip { border: 1px solid var(--gtgs-color); color: var(--gtgs-color); background: #fff; border-radius: 999px; padding: 6px 12px; font-size: 13px; cursor: pointer; }
.gtgs-chip:hover { background: var(--gtgs-color); color: #fff; }

#gtgs-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid #e3e8ec; background: #fff; }
#gtgs-input { flex: 1; border: 1px solid #cbd2d9; border-radius: 999px; padding: 10px 14px; font: inherit; color: #1f2933; background: #fff; min-width: 0; }
#gtgs-input:focus { outline: 2px solid var(--gtgs-color); outline-offset: 0; border-color: transparent; }
#gtgs-send { background: var(--gtgs-color); color: #fff; border: 0; border-radius: 999px; padding: 0 16px; font-weight: 600; cursor: pointer; }
#gtgs-send:disabled { opacity: .55; cursor: not-allowed; }

@media (max-width: 480px) {
  #gtgs-root { right: 12px; bottom: 12px; }
  #gtgs-panel { position: fixed; right: 8px; left: 8px; bottom: 84px; width: auto; max-width: none; height: calc(100vh - 110px); }
  #gtgs-bubble { max-width: 200px; }
}
@media (prefers-reduced-motion: reduce) {
  #gtgs-panel.gtgs-open, #gtgs-bubble, #gtgs-launcher { animation: none; transition: none; }
  .gtgs-typing i { animation: none; }
}
