  #gb-chat-wrap * { box-sizing: border-box; margin: 0; padding: 0; }

  #gb-chat-wrap {
    position: fixed;
    bottom: 24px; right: 24px;
    z-index: 9999;
    font-family: 'DM Sans', 'Segoe UI', sans-serif;
  }

  /* ── TOGGLE BUTTON ── */
  #gb-toggle {
    width: 58px; height: 58px;
    background: #c9a84c;
    border: none; border-radius: 50%;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 8px 32px rgba(201,168,76,0.35);
    transition: transform 0.3s, background 0.25s;
    position: relative;
    margin-left: auto;
  }
  #gb-toggle:hover { background: #e8c876; transform: scale(1.08); }
  #gb-toggle svg { width: 26px; height: 26px; fill: #0a0b0f; transition: opacity 0.2s; }
  #gb-toggle .ico-close { display: none; }

  #gb-toggle.open .ico-chat  { display: none; }
  #gb-toggle.open .ico-close { display: block; }

  /* Unread badge */
  #gb-badge {
    position: absolute; top: -4px; right: -4px;
    width: 18px; height: 18px; border-radius: 50%;
    background: #e05c5c; color: #fff;
    font-size: 0.65rem; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    border: 2px solid #0a0b0f;
    animation: badgePop 0.4s ease;
  }
  @keyframes badgePop {
    from { transform: scale(0); }
    to   { transform: scale(1); }
  }

  /* ── CHAT WINDOW ── */
  #gb-window {
    position: absolute;
    bottom: 72px; right: 0;
    width: 360px;
    background: #0d1117;
    border: 1px solid #1e2538;
    box-shadow: 0 24px 64px rgba(0,0,0,0.7);
    display: none;
    flex-direction: column;
    overflow: hidden;
    transform-origin: bottom right;
    animation: windowIn 0.3s cubic-bezier(0.34,1.56,0.64,1);
  }
  #gb-window.open { display: flex; }

  @keyframes windowIn {
    from { opacity: 0; transform: scale(0.85) translateY(12px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
  }

  /* Header */
  #gb-header {
    background: linear-gradient(135deg, #111520 0%, #0d1117 100%);
    border-bottom: 1px solid #1e2538;
    padding: 1.1rem 1.2rem;
    display: flex; align-items: center; gap: 0.8rem;
  }
  .gb-avatar {
    width: 38px; height: 38px; flex-shrink: 0;
    border: 1px solid rgba(201,168,76,0.3);
    display: flex; align-items: center; justify-content: center;
    color: #c9a84c; font-size: 1rem;
    background: rgba(201,168,76,0.06);
  }
  .gb-header-info {}
  .gb-bot-name {
    font-size: 0.88rem; font-weight: 600;
    color: #f4f2ed; letter-spacing: 0.03em;
  }
  .gb-status {
    display: flex; align-items: center; gap: 0.4rem;
    font-size: 0.7rem; color: #8b8ea8; margin-top: 0.1rem;
  }
  .gb-dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: #4caf82;
    animation: pulse 2s infinite;
  }
  @keyframes pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.4; }
  }
  .gb-close-btn {
    margin-left: auto; background: none; border: none;
    color: #8b8ea8; cursor: pointer; font-size: 1.1rem;
    padding: 0.2rem; transition: color 0.2s;
  }
  .gb-close-btn:hover { color: #c9a84c; }

  /* Messages area */
  #gb-messages {
    flex: 1; overflow-y: auto;
    padding: 1rem; display: flex;
    flex-direction: column; gap: 0.7rem;
    max-height: 320px; min-height: 220px;
    scrollbar-width: thin;
    scrollbar-color: #1e2538 transparent;
  }
  #gb-messages::-webkit-scrollbar { width: 3px; }
  #gb-messages::-webkit-scrollbar-thumb { background: #1e2538; }

  /* Message bubbles */
  .gb-msg {
    display: flex; flex-direction: column;
    max-width: 85%;
    animation: msgIn 0.25s ease;
  }
  @keyframes msgIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  .gb-msg.bot  { align-self: flex-start; }
  .gb-msg.user { align-self: flex-end; }

  .gb-bubble {
    padding: 0.7rem 0.95rem;
    font-size: 0.83rem; line-height: 1.55;
    border-radius: 0;
  }
  .gb-msg.bot  .gb-bubble {
    background: #111520;
    border: 1px solid #1e2538;
    color: #f4f2ed;
    border-left: 2px solid #c9a84c;
  }
  .gb-msg.user .gb-bubble {
    background: #c9a84c;
    color: #0a0b0f;
    font-weight: 500;
  }
  .gb-time {
    font-size: 0.62rem; color: #8b8ea8;
    margin-top: 0.25rem;
  }
  .gb-msg.user .gb-time { text-align: right; }

  /* Typing indicator */
  .gb-typing .gb-bubble {
    padding: 0.7rem 1rem;
    display: flex; gap: 4px; align-items: center;
  }
  .gb-typing .gb-bubble span {
    width: 6px; height: 6px; border-radius: 50%;
    background: #c9a84c; display: inline-block;
    animation: typingDot 1.2s infinite;
  }
  .gb-typing .gb-bubble span:nth-child(2) { animation-delay: 0.2s; }
  .gb-typing .gb-bubble span:nth-child(3) { animation-delay: 0.4s; }
  @keyframes typingDot {
    0%, 80%, 100% { transform: translateY(0); opacity: 0.5; }
    40%           { transform: translateY(-4px); opacity: 1; }
  }

  /* Quick reply buttons */
  #gb-quick-replies {
    display: flex; flex-wrap: wrap; gap: 0.45rem;
    padding: 0.6rem 1rem 0.2rem;
  }
  .gb-qr {
    background: transparent;
    border: 1px solid rgba(201,168,76,0.3);
    color: #c9a84c; font-size: 0.75rem;
    padding: 0.4rem 0.85rem; cursor: pointer;
    font-family: inherit; letter-spacing: 0.04em;
    transition: background 0.2s, color 0.2s;
    text-align: left;
  }
  .gb-qr:hover { background: #c9a84c; color: #0a0b0f; }

  /* Input row */
  #gb-input-row {
    display: flex; gap: 0;
    border-top: 1px solid #1e2538;
    padding: 0.7rem 1rem;
    background: #0a0b0f;
  }
  #gb-input {
    flex: 1; background: #111520;
    border: 1px solid #1e2538; border-right: none;
    color: #f4f2ed; font-family: inherit;
    font-size: 0.82rem; padding: 0.6rem 0.9rem;
    outline: none; transition: border-color 0.25s;
  }
  #gb-input::placeholder { color: rgba(139,142,168,0.5); }
  #gb-input:focus { border-color: #c9a84c; }

  #gb-send {
    background: #c9a84c; border: none;
    padding: 0 1rem; cursor: pointer;
    transition: background 0.2s;
    display: flex; align-items: center; justify-content: center;
  }
  #gb-send:hover { background: #e8c876; }
  #gb-send svg { width: 16px; height: 16px; fill: #0a0b0f; }

  /* Powered by */
  #gb-footer {
    text-align: center; padding: 0.45rem;
    font-size: 0.62rem; color: rgba(139,142,168,0.5);
    border-top: 1px solid #1e2538; background: #0a0b0f;
    letter-spacing: 0.06em;
  }
  #gb-footer span { color: #c9a84c; }

  /* Input form for lead capture */
  .gb-form-field {
    display: flex; flex-direction: column; gap: 0.35rem;
    padding: 0.5rem 1rem;
  }
  .gb-form-label {
    font-size: 0.68rem; letter-spacing: 0.14em;
    text-transform: uppercase; color: #8b8ea8;
  }
  .gb-form-input {
    background: #111520; border: 1px solid #1e2538;
    color: #f4f2ed; font-family: inherit;
    font-size: 0.82rem; padding: 0.6rem 0.9rem;
    outline: none; transition: border-color 0.25s;
    width: 100%;
  }
  .gb-form-input:focus { border-color: #c9a84c; }
  .gb-form-input::placeholder { color: rgba(139,142,168,0.4); }

  /* Mobile responsive */
  @media (max-width: 420px) {
    #gb-chat-wrap { bottom: 16px; right: 16px; }
    #gb-window { width: calc(100vw - 32px); right: 0; }
  }
</style>
