
  :root{
    --bg-1: #0a0e1a;
    --bg-2: #0f1729;
    --text-primary: #f5f6f8;
    --text-secondary: #99a1b3;
    --text-muted: #5c6478;
    --accent: #3fd6a8;
    --glass-bg: rgba(255,255,255,0.06);
    --glass-border: rgba(255,255,255,0.12);
    /* Solid-ish dark base for the chat panel itself, so text stays readable
       no matter what color the host page's background is. The translucent
       --glass-bg above is still used for elements *inside* the panel
       (message bubbles, form cards, etc.) since those sit on top of this
       dark base, not directly on the host page. */
    --panel-bg: rgba(13,18,32,0.94);
    --bubble-user: #3fd6a8;
    --bubble-bot: rgba(255,255,255,0.07);
  }

  #spockbot-root, #spockbot-root *{ box-sizing: border-box; }
  #spockbot-root{
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Helvetica, Arial, sans-serif;
  }

  /* ---- Launcher ---- */
  #spockbot-root .launcher{
    position: fixed;
    bottom: 28px;
    right: 28px;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--accent);
    border: none;
    box-shadow: 0 8px 24px rgba(63,214,168,0.35);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: transform 0.2s ease;
    z-index: 999;
    padding: 0;
  }
  #spockbot-root .launcher:hover{ transform: scale(1.06); }
  #spockbot-root .launcher img{
    width: 100%; height: 100%; object-fit: cover;
  }
  #spockbot-root .launcher .dot{
    position: absolute;
    top: -2px; right: -2px;
    width: 13px; height: 13px;
    background: #ff5c5c;
    border-radius: 50%;
    border: 2px solid var(--bg-1);
  }

  /* ---- Chat window ---- */
  #spockbot-root .chat{
    position: fixed;
    bottom: 104px;
    right: 28px;
    width: 380px;
    max-width: calc(100vw - 40px);
    height: 460px;
    max-height: calc(100vh - 150px);
    border-radius: 18px;
    background: var(--panel-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(20px) saturate(140%);
    -webkit-backdrop-filter: blur(20px) saturate(140%);
    box-shadow: 0 20px 60px rgba(0,0,0,0.45);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 998;
    opacity: 0;
    transform: translateY(16px) scale(0.98);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
  }
  #spockbot-root .chat.open{
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
  }

  #spockbot-root .chat-header{
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid var(--glass-border);
    flex-shrink: 0;
  }
  #spockbot-root .chat-avatar{
    width: 36px; height: 36px;
    border-radius: 50%;
    overflow: hidden;
    border: 1.5px solid var(--accent);
    flex-shrink: 0;
    box-shadow: 0 0 12px rgba(63,214,168,0.35);
  }
  #spockbot-root .chat-avatar img{ width: 100%; height: 100%; object-fit: cover; }
  #spockbot-root .chat-header-text p{ margin: 0; }
  #spockbot-root .chat-title{ font-size: 14px; font-weight: 600; color: var(--text-primary); }
  #spockbot-root .chat-descriptor{ font-size: 10.5px; color: var(--text-muted); margin-top: 1px !important; }
  #spockbot-root .chat-status{ font-size: 11px; color: var(--accent); display: flex; align-items: center; gap: 5px; }
  #spockbot-root .chat-status::before{
    content: "";
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--accent);
  }
  #spockbot-root .chat-close{
    margin-left: auto;
    background: none; border: none;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
    line-height: 1;
    padding: 4px;
  }
  #spockbot-root .chat-close:hover{ color: var(--text-primary); }

  #spockbot-root .chat-body{
    flex: 1;
    overflow-y: auto;
    padding: 16px 16px 8px;
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
  #spockbot-root .chat-body::-webkit-scrollbar{ width: 5px; }
  #spockbot-root .chat-body::-webkit-scrollbar-thumb{ background: rgba(255,255,255,0.15); border-radius: 3px; }

  /* ---- Hero mascot (idea B: shown once on first open) ---- */
  #spockbot-root .hero-wrap{
    display: flex;
    justify-content: center;
    padding: 4px 0 2px;
    animation: spockbot-hero-in 0.5s ease both;
  }
  #spockbot-root .hero-wrap img{
    width: 150px;
    height: auto;
    filter: drop-shadow(0 10px 22px rgba(0,0,0,0.5));
  }
  @keyframes spockbot-hero-in{
    from{ opacity: 0; transform: translateY(10px) scale(0.94); }
    to{ opacity: 1; transform: translateY(0) scale(1); }
  }

  #spockbot-root .msg{
    max-width: 86%;
    padding: 10px 13px;
    border-radius: 14px;
    font-size: 13.5px;
    line-height: 1.55;
    animation: spockbot-msg-in 0.22s ease both;
  }
  @keyframes spockbot-msg-in{
    from{ opacity: 0; transform: translateY(6px); }
    to{ opacity: 1; transform: translateY(0); }
  }
  #spockbot-root .msg.bot{
    background: var(--bubble-bot);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
  }
  #spockbot-root .msg.bot ul{ margin: 6px 0 0; padding-left: 18px; }
  #spockbot-root .msg.bot li{ margin-bottom: 3px; }
  #spockbot-root .msg.user{
    background: var(--bubble-user);
    color: #062018;
    font-weight: 500;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
  }

  #spockbot-root .quick-replies{
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-self: flex-start;
    max-width: 100%;
  }
  #spockbot-root .qr-btn{
    background: rgba(63,214,168,0.08);
    border: 1px solid rgba(63,214,168,0.3);
    color: var(--accent);
    font-size: 12.5px;
    padding: 7px 12px;
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.15s ease;
  }
  #spockbot-root .qr-btn:hover{ background: rgba(63,214,168,0.16); }
  #spockbot-root .qr-btn.back{
    background: rgba(255,255,255,0.05);
    border-color: var(--glass-border);
    color: var(--text-secondary);
  }
  #spockbot-root .qr-btn.back:hover{ background: rgba(255,255,255,0.09); }
  #spockbot-root .qr-btn.cta{
    background: var(--accent);
    border-color: var(--accent);
    color: #062018;
    font-weight: 600;
  }
  #spockbot-root .qr-btn.cta:hover{ opacity: 0.9; background: var(--accent); }

  #spockbot-root .typing{
    display: flex;
    gap: 4px;
    padding: 12px 14px;
    background: var(--bubble-bot);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    border-bottom-left-radius: 4px;
    align-self: flex-start;
    width: fit-content;
  }
  #spockbot-root .typing span{
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--text-muted);
    animation: spockbot-blink 1.2s infinite;
  }
  #spockbot-root .typing span:nth-child(2){ animation-delay: 0.2s; }
  #spockbot-root .typing span:nth-child(3){ animation-delay: 0.4s; }
  @keyframes spockbot-blink{
    0%, 80%, 100%{ opacity: 0.3; }
    40%{ opacity: 1; }
  }

  /* ---- Pricing cards ---- */
  #spockbot-root .price-cards{
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-self: stretch;
  }
  #spockbot-root .price-card{
    background: var(--bubble-bot);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 10px 12px;
  }
  #spockbot-root .price-card.highlight{
    border-color: rgba(63,214,168,0.4);
    background: rgba(63,214,168,0.07);
  }
  #spockbot-root .price-card-top{
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 3px;
    gap: 8px;
  }
  #spockbot-root .price-tier{ font-size: 13px; font-weight: 700; color: var(--text-primary); }
  #spockbot-root .price-value{ font-size: 12px; font-weight: 600; color: var(--accent); text-align: right; }
  #spockbot-root .price-desc{ font-size: 12px; color: var(--text-secondary); margin: 0 0 8px; }
  #spockbot-root .price-card .qr-btn{ font-size: 11.5px; padding: 6px 11px; }

  /* ---- Form (BOM / message / lead) ---- */
  #spockbot-root .form-card{
    background: var(--bubble-bot);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    padding: 14px;
    align-self: stretch;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  #spockbot-root .form-card select,
  #spockbot-root .form-card input,
  #spockbot-root .form-card textarea{
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 9px 10px;
    font-size: 13px;
    color: var(--text-primary);
    outline: none;
    font-family: inherit;
    resize: vertical;
  }
  #spockbot-root .form-card select option{ background: #12182a; color: var(--text-primary); }
  #spockbot-root .form-card textarea{ min-height: 60px; }
  #spockbot-root .form-card input::placeholder,
  #spockbot-root .form-card textarea::placeholder{ color: var(--text-muted); }
  #spockbot-root .form-card select:focus,
  #spockbot-root .form-card input:focus,
  #spockbot-root .form-card textarea:focus{ border-color: var(--accent); }
  #spockbot-root .form-radio-row{
    display: flex;
    gap: 14px;
    font-size: 12.5px;
    color: var(--text-secondary);
    padding: 2px 0 2px;
  }
  #spockbot-root .form-radio-row label{ display: flex; align-items: center; gap: 5px; cursor: pointer; }
  #spockbot-root .form-submit{
    background: var(--accent);
    border: none;
    border-radius: 8px;
    padding: 9px 10px;
    font-size: 13px;
    font-weight: 600;
    color: #062018;
    cursor: pointer;
    margin-top: 2px;
  }
  #spockbot-root .form-submit:hover{ opacity: 0.92; }
  #spockbot-root .form-note{ font-size: 11px; color: var(--text-muted); margin: 0; line-height: 1.5; }
  #spockbot-root .form-field-label{ font-size: 11px; color: var(--text-muted); margin: 2px 0 -3px; }

  #spockbot-root .chat-input-row{
    display: flex;
    gap: 8px;
    padding: 12px 14px;
    border-top: 1px solid var(--glass-border);
    flex-shrink: 0;
  }
  #spockbot-root .chat-input-row input{
    flex: 1;
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--glass-border);
    border-radius: 999px;
    padding: 10px 14px;
    font-size: 13px;
    color: var(--text-primary);
    outline: none;
    font-family: inherit;
  }
  #spockbot-root .chat-input-row input::placeholder{ color: var(--text-muted); }
  #spockbot-root .chat-input-row input:focus{ border-color: var(--accent); }
  #spockbot-root .chat-send{
    width: 38px; height: 38px;
    border-radius: 50%;
    background: var(--accent);
    border: none;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
  }
  #spockbot-root .chat-send svg{ width: 16px; height: 16px; }
  #spockbot-root .chat-send:hover{ opacity: 0.9; }

  @media (max-width: 420px){
    #spockbot-root .chat{ right: 16px; bottom: 96px; }
    #spockbot-root .launcher{ right: 16px; bottom: 20px; }
  }