/* ── Bubble ───────────────────────────────────────────── */
.gild-chat-bubble{position:fixed;bottom:24px;right:24px;z-index:9999;width:56px;height:56px;border-radius:50%;border:1px solid #2a2a2a;cursor:pointer;background:#0A0A0B;color:#fff;box-shadow:0 4px 24px rgba(0,0,0,0.6);display:flex;align-items:center;justify-content:center;transition:transform 0.2s ease,box-shadow 0.2s ease,background 0.2s ease}
.gild-chat-bubble:hover{transform:scale(1.08);background:#111113;box-shadow:0 6px 32px rgba(0,0,0,0.7)}
.gild-chat-bubble svg{width:24px;height:24px;fill:none;stroke:#EDEDEF;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}

/* ── Panel ───────────────────────────────────────────── */
.gild-chat-panel{position:fixed;bottom:92px;right:24px;z-index:9999;width:360px;height:520px;background:#0E0D14;border:1px solid #1C1A2B;border-radius:14px;box-shadow:0 12px 40px rgba(0,0,0,0.55);display:flex;flex-direction:column;opacity:0;visibility:hidden;transform:translateY(14px);transition:opacity 0.22s ease,transform 0.22s ease,visibility 0.22s;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;overflow:hidden}
.gild-chat-panel.gild-chat-open{opacity:1;visibility:visible;transform:translateY(0)}

/* ── Header ──────────────────────────────────────────── */
.gcw-header{display:flex;align-items:center;justify-content:space-between;padding:12px 14px;border-bottom:1px solid rgba(255,255,255,0.06);flex-shrink:0;background:#111113}
.gcw-header-left{display:flex;align-items:center;gap:10px}
.gcw-header-right{display:flex;align-items:center;gap:6px}
.gcw-avatar{width:34px;height:34px;border-radius:50%;background:linear-gradient(135deg,#2a2a2a,#111113);border:1px solid rgba(255,255,255,0.12);display:flex;align-items:center;justify-content:center;font-size:0.85rem;font-weight:700;color:#fff;flex-shrink:0}
.gcw-title{color:#EDEDEF;font-size:0.9rem;font-weight:600;line-height:1.2}
.gcw-subtitle{font-size:0.7rem;color:rgba(237,237,239,0.45);margin-top:1px}
.gcw-online{display:flex;align-items:center;gap:4px}
.gcw-dot{width:6px;height:6px;border-radius:50%;background:#4ade80;display:inline-block;flex-shrink:0}
.gcw-close{background:none;border:none;color:rgba(237,237,239,0.45);cursor:pointer;font-size:1.3rem;padding:2px 4px;line-height:1;transition:color 0.15s}
.gcw-close:hover{color:#EDEDEF}
.gcw-new-btn{background:none;border:none;color:rgba(237,237,239,0.45);cursor:pointer;padding:3px;line-height:0;transition:color 0.15s}
.gcw-new-btn:hover{color:#EDEDEF}
.gcw-new-btn svg{width:18px;height:18px}

/* ── Intro form ──────────────────────────────────────── */
.gcw-form-body{flex:1;overflow-y:auto;padding:16px;display:flex;flex-direction:column;gap:10px}
.gcw-input,.gcw-textarea{width:100%;box-sizing:border-box;background:#1C1A2B;border:1px solid rgba(255,255,255,0.08);border-radius:8px;color:#E8E4DC;font-size:0.85rem;padding:10px 12px;font-family:inherit;outline:none;transition:border-color 0.15s}
.gcw-input:focus,.gcw-textarea:focus{border-color:rgba(255,255,255,0.4)}
.gcw-textarea{resize:none;height:80px}
.gcw-error{color:#E85D5D;font-size:0.78rem}
.gcw-send-btn{background:#fff;color:#0A0A0B;border:none;border-radius:8px;padding:11px 16px;font-size:0.85rem;font-weight:600;cursor:pointer;transition:opacity 0.15s;width:100%;margin-top:2px}
.gcw-send-btn:hover{opacity:0.88}
.gcw-send-btn:disabled{opacity:0.45;cursor:not-allowed}

/* ── Chat thread ─────────────────────────────────────── */
.gcw-thread{flex:1;overflow-y:auto;padding:14px 12px;display:flex;flex-direction:column;gap:6px;scroll-behavior:smooth}
.gcw-empty{color:rgba(237,237,239,0.3);font-size:0.8rem;text-align:center;margin:auto}
.gcw-row{display:flex;flex-direction:column;max-width:82%}
.gcw-row--visitor{align-self:flex-end;align-items:flex-end}
.gcw-row--gild{align-self:flex-start;align-items:flex-start}
.gcw-bubble{padding:9px 13px;border-radius:14px;font-size:0.85rem;line-height:1.5;word-break:break-word}
.gcw-bubble--visitor{background:#fff;color:#111;border-bottom-right-radius:4px}
.gcw-bubble--gild{background:#1C1A2B;color:#E8E4DC;border:1px solid rgba(255,255,255,0.08);border-bottom-left-radius:4px}
.gcw-time{font-size:0.65rem;color:rgba(237,237,239,0.3);margin-top:3px;padding:0 3px}
.gcw-send-error{font-size:0.75rem;color:#E85D5D;text-align:center;padding:4px 0}

/* ── Input row ───────────────────────────────────────── */
.gcw-input-row{display:flex;align-items:flex-end;gap:8px;padding:10px 12px;border-top:1px solid rgba(255,255,255,0.06);flex-shrink:0;background:#111113}
.gcw-msg-input{flex:1;background:#1C1A2B;border:1px solid rgba(255,255,255,0.08);border-radius:10px;color:#E8E4DC;font-size:0.85rem;padding:9px 12px;font-family:inherit;outline:none;resize:none;line-height:1.45;max-height:100px;overflow-y:auto;transition:border-color 0.15s}
.gcw-msg-input:focus{border-color:rgba(255,255,255,0.4)}
.gcw-send-icon{width:36px;height:36px;border-radius:50%;background:#FFFFFF;border:none;cursor:pointer;display:flex;align-items:center;justify-content:center;flex-shrink:0;transition:background 0.15s}
.gcw-send-icon:hover{background:rgba(255,255,255,0.85)}
.gcw-send-icon:disabled{opacity:0.45;cursor:not-allowed}
.gcw-send-icon svg{width:15px;height:15px;stroke:#0A0A0B}

/* ── Footer ──────────────────────────────────────────── */
.gild-chat-footer,.gcw-footer{padding:7px 16px;text-align:center;border-top:1px solid rgba(255,255,255,0.04);flex-shrink:0;font-size:0.68rem;color:rgba(237,237,239,0.2)}

/* ── Responsive ──────────────────────────────────────── */
@media(max-width:400px){
  .gild-chat-panel{width:calc(100vw - 16px);right:8px;bottom:84px;height:calc(100vh - 100px)}
  .gild-chat-bubble{bottom:16px;right:16px}
}
@media(prefers-reduced-motion:reduce){
  .gild-chat-bubble,.gild-chat-panel,.gcw-input,.gcw-textarea,.gcw-send-btn,.gcw-close{transition:none!important}
}
