/* teamagogo site assistant: launcher, greeting bubble and chat panel.
   Everything is prefixed tga- so it cannot collide with page styles. */
.tga-root, .tga-root * { box-sizing: border-box; }
.tga-root {
  --tga-teal: #17808e; --tga-deep: #0f6e79; --tga-ink-teal: #0e6e74; --tga-soft: #e5f1ef;
  --tga-coral: #ff7f50; --tga-ink: #16201f; --tga-ink-2: #4a5654; --tga-mist: #f4f5f4; --tga-line: #dfe2d9;
  position: fixed; z-index: 2147483000; right: calc(20px + env(safe-area-inset-right, 0px));
  bottom: calc(20px + env(safe-area-inset-bottom, 0px)); font-family: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 15px; line-height: 1.45; color: var(--tga-ink); display: flex; flex-direction: column; align-items: flex-end; gap: 12px;
}
.tga-root button, .tga-root input { font: inherit; color: inherit; }
.tga-root [hidden] { display: none !important; }

/* launcher */
.tga-launcher {
  position: relative; display: inline-flex; align-items: center; gap: 10px; min-height: 52px; padding: 6px 18px 6px 8px;
  border: 0; border-radius: 999px; background: var(--tga-teal); color: #fff; font-weight: 700; font-size: 15px; cursor: pointer;
  box-shadow: 0 6px 20px rgba(15, 110, 121, .35), 0 1px 3px rgba(0, 0, 0, .15);
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.tga-launcher:hover { background: var(--tga-deep); transform: translateY(-1px); }
.tga-launcher:focus-visible, .tga-close:focus-visible, .tga-send:focus-visible, .tga-quick button:focus-visible, .tga-input:focus-visible {
  outline: 3px solid var(--tga-coral); outline-offset: 2px;
}
.tga-launcher img { width: 38px; height: 38px; border-radius: 50%; background: #fff; display: block; flex: none; }
.tga-dot {
  position: absolute; top: 2px; left: 38px; width: 12px; height: 12px; border-radius: 50%; background: #2fd2c1;
  border: 2px solid #fff; box-shadow: 0 0 0 0 rgba(47, 210, 193, .6);
}
@media (prefers-reduced-motion: no-preference) {
  .tga-dot { animation: tga-ping 2.4s ease-out infinite; }
  .tga-bubble.tga-in { animation: tga-pop .5s cubic-bezier(.2, 1.4, .4, 1) both; }
  .tga-panel.tga-in { animation: tga-rise .22s ease-out both; }
  .tga-typing i { animation: tga-blink 1.2s infinite ease-in-out; }
  .tga-typing i:nth-child(2) { animation-delay: .15s; }
  .tga-typing i:nth-child(3) { animation-delay: .3s; }
}
@keyframes tga-ping { 0% { box-shadow: 0 0 0 0 rgba(47, 210, 193, .6); } 70%, 100% { box-shadow: 0 0 0 9px rgba(47, 210, 193, 0); } }
@keyframes tga-pop { 0% { opacity: 0; transform: translateY(14px) scale(.94); } 60% { opacity: 1; transform: translateY(-5px) scale(1.01); } 100% { transform: none; } }
@keyframes tga-rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes tga-blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }

/* greeting bubble */
.tga-bubble {
  position: relative; width: min(320px, calc(100vw - 40px)); padding: 16px 38px 14px 16px; background: #fff; border: 1px solid var(--tga-line);
  border-radius: 18px 18px 6px 18px; box-shadow: 0 10px 30px rgba(22, 32, 31, .18);
}
.tga-bubble p { margin: 0 0 10px; }
.tga-bubble .tga-x { position: absolute; top: 8px; right: 8px; }
.tga-quick { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.tga-quick button {
  border: 1.5px solid var(--tga-teal); background: #fff; color: var(--tga-ink-teal); font-weight: 700; font-size: 14px; border-radius: 999px;
  padding: 7px 14px; cursor: pointer; text-align: left;
}
.tga-quick button:hover { background: var(--tga-soft); }
.tga-close {
  width: 32px; height: 32px; border: 0; border-radius: 50%; background: transparent; color: inherit; font-size: 22px; line-height: 1;
  cursor: pointer; display: inline-grid; place-items: center; flex: none;
}
.tga-bubble .tga-close { color: var(--tga-ink-2); }
.tga-close:hover { background: rgba(0, 0, 0, .07); }

/* panel */
.tga-panel {
  width: 380px; height: min(560px, calc(100vh - 40px)); display: flex; flex-direction: column; background: var(--tga-mist);
  border-radius: 18px; overflow: hidden; box-shadow: 0 18px 50px rgba(22, 32, 31, .3), 0 0 0 1px rgba(22, 32, 31, .08);
}
.tga-head { display: flex; align-items: center; gap: 10px; padding: 12px 8px 12px 14px; background: var(--tga-teal); color: #fff; }
.tga-head img { width: 38px; height: 38px; border-radius: 50%; background: #fff; flex: none; }
.tga-head .tga-t { flex: 1; min-width: 0; }
.tga-head strong { display: block; font-size: 15.5px; line-height: 1.2; }
.tga-head span { display: block; font-size: 12.5px; opacity: .9; }
.tga-head .tga-close { color: #fff; }
.tga-head .tga-close:hover { background: rgba(255, 255, 255, .18); }
.tga-log { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; overscroll-behavior: contain; }
.tga-msg { max-width: 86%; padding: 9px 13px; border-radius: 16px; word-wrap: break-word; overflow-wrap: anywhere; }
.tga-msg p { margin: 0; }
.tga-msg p + p, .tga-msg ul + p, .tga-msg p + ul { margin-top: 6px; }
.tga-msg ul { margin: 0; padding-left: 18px; }
.tga-msg a { color: var(--tga-ink-teal); font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.tga-user { align-self: flex-end; background: var(--tga-soft); border-bottom-right-radius: 5px; }
.tga-bot { align-self: flex-start; background: #fff; border: 1px solid var(--tga-line); border-bottom-left-radius: 5px; }
.tga-typing { display: inline-flex; gap: 4px; padding: 13px 14px; }
.tga-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--tga-ink-2); display: block; opacity: .6; }
.tga-log .tga-quick { align-self: flex-start; }
.tga-form { display: flex; gap: 8px; padding: 10px 12px 4px; background: #fff; border-top: 1px solid var(--tga-line); }
.tga-input { flex: 1; min-width: 0; border: 1.5px solid var(--tga-line); border-radius: 999px; padding: 10px 14px; background: var(--tga-mist); font-size: 16px; }
.tga-send {
  border: 0; border-radius: 999px; background: var(--tga-coral); color: #1f1a17; font-weight: 800; padding: 0 18px; min-height: 42px; cursor: pointer;
}
.tga-send:disabled { opacity: .55; cursor: default; }
.tga-note { margin: 0; padding: 4px 14px 10px; background: #fff; font-size: 11.5px; color: var(--tga-ink-2); text-align: center; }

@media (max-width: 479px) {
  .tga-launcher { width: 56px; height: 56px; min-height: 56px; padding: 0; justify-content: center; }
  .tga-launcher span.tga-label { display: none; }
  .tga-launcher img { width: 44px; height: 44px; }
  .tga-dot { left: auto; right: 2px; top: 2px; }
}
@media (max-width: 599px) {
  .tga-root.tga-open { inset: 0; right: 0; bottom: 0; gap: 0; }
  .tga-root.tga-open .tga-panel { width: 100%; height: 100%; height: 100dvh; border-radius: 0; box-shadow: none; padding-bottom: env(safe-area-inset-bottom, 0px); background: var(--tga-mist); }
  .tga-root.tga-open .tga-head { padding-top: calc(12px + env(safe-area-inset-top, 0px)); }
}
