#g4ubot {
  --bot-bg: #111111;
  --bot-bg-2: #161616;
  --bot-panel: #141414;
  --bot-line: #2A2A2A;
  --bot-bubble: #1F1F1F;
  --bot-user: #FFD200;
  --bot-text: #F2F2F2;
  --bot-muted: #9A9A9A;
  --bot-accent: #FFD200;
  --bot-dot: #FFD200;
  --bot-green: #34D399;
  font-family: "Plus Jakarta Sans", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}
#g4ubot * { box-sizing: border-box; }

/* ---------- Launcher pill ---------- */
.g4ubot-launcher {
  position: fixed; right: 24px; bottom: 24px; z-index: 9998;
  display: flex; align-items: center; gap: 14px;
  padding: 10px 26px 10px 10px;
  border: 1px solid rgba(255,210,0,.28); border-radius: 999px; cursor: pointer;
  color: var(--bot-text);
  background: linear-gradient(135deg, #1C1C1C 0%, #0B0B0B 100%);
  box-shadow: 0 12px 34px rgba(0,0,0,.55), 0 0 0 1px rgba(255,255,255,.02) inset;
  animation: g4ubot-float 3.6s ease-in-out infinite;
  transition: transform .2s ease, box-shadow .2s ease;
}
.g4ubot-launcher:hover { transform: translateY(-2px); box-shadow: 0 16px 40px rgba(0,0,0,.65), 0 0 24px rgba(255,210,0,.35); }
.g4ubot-launcher:focus-visible { outline: 3px solid var(--bot-accent); outline-offset: 3px; }
.g4ubot-launcher::before {
  content: ""; position: absolute; inset: -6px; border-radius: 999px;
  background: radial-gradient(closest-side, rgba(255,210,0,.35), transparent);
  z-index: -1; filter: blur(8px); animation: g4ubot-glow 2.8s ease-in-out infinite;
}
.g4ubot-launcher__icon {
  position: relative; flex: none;
  width: 54px; height: 54px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 30% 30%, #FFE24D, #FFD200 60%, #E6BD00);
  border: 0;
  color: #0B0B0B;
}
.g4ubot-launcher__icon::after {
  content: ""; position: absolute; inset: -5px; border-radius: 50%;
  border: 2px solid rgba(255,210,0,.55);
  animation: g4ubot-ring 2.2s ease-out infinite;
}
.g4ubot-launcher__dot {
  position: absolute; top: 2px; right: 2px; width: 13px; height: 13px; border-radius: 50%;
  background: var(--bot-green); border: 2px solid #0B0B0B;
}
.g4ubot-launcher__text { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; text-align: left; }
.g4ubot-launcher__text small { font-size: 11px; font-weight: 600; letter-spacing: 1.6px; text-transform: uppercase; color: var(--bot-muted); }
.g4ubot-launcher__text strong { font-size: 17px; font-weight: 700; color: #FFFFFF; margin-top: 3px; }
.g4ubot-launcher__close { display: none; }

#g4ubot.is-open .g4ubot-launcher { animation: none; padding: 0; width: 60px; height: 60px; justify-content: center; }
#g4ubot.is-open .g4ubot-launcher__icon,
#g4ubot.is-open .g4ubot-launcher__text { display: none; }
#g4ubot.is-open .g4ubot-launcher__close { display: block; }
#g4ubot.is-open .g4ubot-launcher::before { display: none; }

@keyframes g4ubot-float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes g4ubot-ring { 0% { transform: scale(.9); opacity: .9; } 100% { transform: scale(1.35); opacity: 0; } }
@keyframes g4ubot-glow { 0%,100% { opacity: .55; } 50% { opacity: 1; } }

/* ---------- Panel ---------- */
.g4ubot-panel {
  position: fixed; right: 24px; bottom: 100px; z-index: 9999;
  width: 400px; max-width: calc(100vw - 32px);
  height: 640px; max-height: calc(100vh - 130px);
  display: flex; flex-direction: column; overflow: hidden;
  border-radius: 18px; border: 1px solid var(--bot-line);
  background: radial-gradient(120% 60% at 50% 15%, #262626 0%, var(--bot-panel) 55%, var(--bot-bg) 100%);
  color: var(--bot-text);
  box-shadow: 0 24px 60px rgba(0,0,0,.6);
  animation: g4ubot-in .22s ease-out;
}
.g4ubot-panel[hidden] { display: none; }
@keyframes g4ubot-in { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }

.g4ubot-head {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; border-bottom: 1px solid var(--bot-line);
  background: rgba(0,0,0,.55); backdrop-filter: blur(6px);
}
.g4ubot-head__avatar {
  position: relative; flex: none; width: 42px; height: 42px; border-radius: 50%;
  background: #0B0B0B; border: 1px solid var(--bot-line);
  display: flex; align-items: center; justify-content: center; overflow: visible;
}
.g4ubot-head__avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.g4ubot-head__avatar span { font-weight: 700; color: var(--bot-dot); }
.g4ubot-online { position: absolute; right: -1px; bottom: -1px; width: 12px; height: 12px; border-radius: 50%; background: var(--bot-green); border: 2px solid #0B0B0B; }
.g4ubot-head__text { flex: 1; line-height: 1.25; }
.g4ubot-head__text strong { display: block; font-size: 15px; font-weight: 700; color: #FFFFFF; }
.g4ubot-head__text small { font-size: 12px; color: var(--bot-muted); display: inline-flex; align-items: center; gap: 6px; }
.g4ubot-online-inline { width: 7px; height: 7px; border-radius: 50%; background: var(--bot-green); display: inline-block; }
.g4ubot-close { background: transparent; border: 0; color: var(--bot-muted); cursor: pointer; width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.g4ubot-close:hover { background: rgba(255,255,255,.06); color: #FFFFFF; }

.g4ubot-log { flex: 1; overflow-y: auto; padding: 18px 16px 10px; display: flex; flex-direction: column; gap: 14px; scrollbar-width: thin; scrollbar-color: #303030 transparent; }
.g4ubot-day { align-self: center; font-size: 12px; font-weight: 600; color: #C4C4C4; background: #1F1F1F; padding: 4px 12px; border-radius: 999px; }

.g4ubot-row { display: flex; align-items: flex-end; gap: 10px; max-width: 88%; }
.g4ubot-row.bot { align-self: flex-start; }
.g4ubot-row.user { align-self: flex-end; flex-direction: row-reverse; }
.g4ubot-row__avatar { flex: none; width: 30px; height: 30px; border-radius: 50%; background: #0B0B0B; overflow: hidden; border: 1px solid var(--bot-line); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: var(--bot-dot); }
.g4ubot-row__avatar img { width: 100%; height: 100%; object-fit: cover; }
.g4ubot-row.user .g4ubot-row__avatar { display: none; }
.g4ubot-col { display: flex; flex-direction: column; min-width: 0; }
.g4ubot-row.user .g4ubot-col { align-items: flex-end; }

.g4ubot-msg { padding: 11px 15px; border-radius: 18px; font-size: 14.5px; line-height: 1.5; word-wrap: break-word; white-space: pre-wrap; }
.g4ubot-row.bot .g4ubot-msg { background: var(--bot-bubble); color: var(--bot-text); border-top-left-radius: 6px; border: 1px solid rgba(255,255,255,.04); }
.g4ubot-row.user .g4ubot-msg { background: linear-gradient(135deg, #FFD200, #E6BD00); color: #0B0B0B; font-weight: 500; border-bottom-right-radius: 6px; }
.g4ubot-row.error .g4ubot-msg { background: #3A1E26; color: #FFC9D2; border: 1px solid #5A2A35; }
.g4ubot-msg a { color: #FFD200; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.g4ubot-row.user .g4ubot-msg a { color: #0B0B0B; text-decoration: underline; }
.g4ubot-meta { font-size: 11px; color: var(--bot-muted); margin-top: 5px; padding: 0 4px; }

.g4ubot-typing .g4ubot-msg { display: inline-flex; gap: 4px; padding: 14px 16px; }
.g4ubot-typing span { width: 7px; height: 7px; border-radius: 50%; background: #9A9A9A; animation: g4ubot-bounce 1.1s infinite ease-in-out; }
.g4ubot-typing span:nth-child(2) { animation-delay: .15s; }
.g4ubot-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes g4ubot-bounce { 0%, 80%, 100% { transform: translateY(0); opacity: .45; } 40% { transform: translateY(-4px); opacity: 1; } }

/* ---------- Composer ---------- */
.g4ubot-emoji {
  display: flex; flex-wrap: wrap; gap: 4px; padding: 8px 14px;
  border-top: 1px solid var(--bot-line); background: rgba(0,0,0,.6);
}
.g4ubot-emoji[hidden] { display: none; }
.g4ubot-emoji button { background: none; border: 0; font-size: 20px; width: 36px; height: 36px; border-radius: 8px; cursor: pointer; }
.g4ubot-emoji button:hover { background: rgba(255,255,255,.07); }

.g4ubot-form { display: flex; align-items: flex-end; gap: 10px; padding: 14px; border-top: 1px solid var(--bot-line); background: rgba(0,0,0,.55); }
.g4ubot-emoji-btn { flex: none; width: 40px; height: 44px; background: none; border: 0; font-size: 22px; cursor: pointer; border-radius: 10px; }
.g4ubot-emoji-btn:hover { background: rgba(255,255,255,.06); }
.g4ubot-input {
  flex: 1; resize: none; min-height: 44px; max-height: 120px;
  padding: 11px 18px; border-radius: 22px;
  border: 1px solid transparent; background: #232323; color: var(--bot-text);
  font: inherit; font-size: 14.5px; line-height: 1.45; outline: none;
}
.g4ubot-input::placeholder { color: #8A8A8A; }
.g4ubot-input:focus { border-color: #FFD200; box-shadow: 0 0 0 3px rgba(255,210,0,.18); }
.g4ubot-send {
  flex: none; width: 44px; height: 44px; border-radius: 50%; border: 0; cursor: pointer;
  background: linear-gradient(135deg, #FFD200, #E6BD00); color: #0B0B0B;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 16px rgba(255,210,0,.35); transition: transform .15s ease, opacity .15s ease;
}
.g4ubot-send:hover { transform: translateY(-1px); }
.g4ubot-send:disabled { opacity: .45; cursor: default; transform: none; box-shadow: none; background: #2A2A2A; }

/* ---------- Mobile ---------- */
@media (max-width: 575px) {
  .g4ubot-launcher { right: 14px; bottom: 14px; padding: 8px 18px 8px 8px; gap: 10px; }
  .g4ubot-launcher__icon { width: 46px; height: 46px; }
  .g4ubot-launcher__text strong { font-size: 15px; }
  .g4ubot-launcher__text small { font-size: 10px; }
  .g4ubot-panel { right: 0; bottom: 0; width: 100vw; max-width: 100vw; height: 100%; max-height: 100%; border-radius: 0; border: 0; }
  #g4ubot.is-open .g4ubot-launcher { display: none; }
  .g4ubot-input { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .g4ubot-launcher, .g4ubot-launcher::before, .g4ubot-launcher__icon::after, .g4ubot-typing span, .g4ubot-panel { animation: none !important; }
}
