:root{--primary:#8b5cf6;--accent:#22d3ee;--success:#22c55e;--danger:#fb7185;--warn:#fbbf24;--surface:rgba(15,18,34,.97);--surface2:rgba(23,28,50,.96);--border:rgba(148,163,184,.18);--text:#f8fafc;--text-muted:#a8b3c7;--shadow:0 22px 65px rgba(0,0,0,.42)}
#gr-chat-launcher{position:fixed;bottom:22px;right:22px;width:62px;height:62px;border-radius:22px;background:linear-gradient(135deg,var(--primary),#06b6d4);border:1px solid rgba(255,255,255,.18);cursor:pointer;box-shadow:0 18px 46px rgba(139,92,246,.34);display:flex;align-items:center;justify-content:center;z-index:99998;transition:transform .2s,box-shadow .2s;animation:pulse-ring 2.8s infinite}
#gr-chat-launcher:hover{transform:translateY(-3px) scale(1.04)}
@keyframes pulse-ring{0%,100%{box-shadow:0 18px 46px rgba(139,92,246,.32)}50%{box-shadow:0 18px 52px rgba(34,211,238,.34),0 0 0 10px rgba(139,92,246,.09)}}
#gr-chat-launcher svg{width:27px;height:27px;fill:white}#gr-unread-badge{position:absolute;top:-7px;right:-7px;background:linear-gradient(135deg,#fbbf24,#fb7185);color:#111827;font-size:11px;font-weight:900;width:24px;height:24px;border-radius:999px;display:none;align-items:center;justify-content:center;border:2px solid #fff}
#gr-chat-window{position:fixed;bottom:92px;right:22px;width:360px;height:min(560px,calc(100vh - 124px));background:linear-gradient(180deg,rgba(15,18,34,.98),rgba(10,12,24,.98));border:1px solid var(--border);border-radius:24px;box-shadow:var(--shadow);display:none;flex-direction:column;z-index:99999;overflow:hidden;font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;animation:slideUp .22s ease;backdrop-filter:blur(18px);max-width:calc(100vw - 28px)}
#gr-chat-window:before{content:"";position:absolute;inset:0 0 auto 0;height:132px;background:radial-gradient(circle at 18% 0%,rgba(139,92,246,.28),transparent 56%),radial-gradient(circle at 92% 0%,rgba(34,211,238,.22),transparent 48%);pointer-events:none}@keyframes slideUp{from{opacity:0;transform:translateY(14px) scale(.98)}to{opacity:1;transform:none}}
#gr-chat-header{position:relative;background:linear-gradient(135deg,rgba(139,92,246,.96),rgba(6,182,212,.9));padding:13px 14px;display:flex;align-items:center;gap:10px;flex-shrink:0}#gr-header-avatar{width:40px;height:40px;border-radius:15px;background:rgba(255,255,255,.18);display:flex;align-items:center;justify-content:center;font-size:20px;flex-shrink:0;border:1px solid rgba(255,255,255,.18)}#gr-header-info{flex:1}#gr-header-info h4{margin:0;color:#fff;font-size:15px;font-weight:900;letter-spacing:-.025em}#gr-header-info span{color:rgba(255,255,255,.84);font-size:12px;display:flex;align-items:center;gap:5px;font-weight:650}#gr-status-dot{width:8px;height:8px;border-radius:50%;background:#4ade80;display:inline-block;box-shadow:0 0 0 4px rgba(74,222,128,.16);animation:blink 1.5s infinite}@keyframes blink{0%,100%{opacity:1}50%{opacity:.45}}#gr-close-btn{background:rgba(255,255,255,.12);border:1px solid rgba(255,255,255,.12);cursor:pointer;color:rgba(255,255,255,.82);padding:5px 8px;border-radius:11px;transition:all .15s;font-size:22px;line-height:1}#gr-close-btn:hover{color:#fff;background:rgba(255,255,255,.2)}
#gr-register-form{position:relative;flex:1;padding:22px 18px;overflow-y:auto;display:flex;flex-direction:column;gap:12px}.gr-kicker{display:inline-flex;align-self:flex-start;border:1px solid rgba(34,211,238,.28);background:rgba(34,211,238,.09);color:#67e8f9;border-radius:999px;padding:6px 9px;font-size:10px;font-weight:850;text-transform:uppercase;letter-spacing:.08em}#gr-register-form h3{margin:0;color:var(--text);font-size:20px;letter-spacing:-.04em;text-align:left}#gr-register-form p{margin:0 0 6px;color:var(--text-muted);font-size:13px;line-height:1.5;text-align:left}#gr-consent-box{display:grid;gap:8px;margin:4px 0 10px;padding:12px;border:1px solid rgba(148,163,184,.16);border-radius:14px;background:rgba(2,6,23,.45)}#gr-consent-box label{display:flex;align-items:flex-start;gap:8px;color:var(--text-muted);font-size:12px;line-height:1.4;cursor:pointer}#gr-consent-box input[type=checkbox]{width:16px;height:16px;margin-top:2px;accent-color:var(--primary);flex-shrink:0}.gr-input{background:rgba(2,6,23,.62);border:1px solid var(--border);border-radius:15px;padding:12px 14px;color:var(--text);font-size:14px;width:100%;box-sizing:border-box;outline:none;transition:all .2s}.gr-input:focus{border-color:rgba(34,211,238,.62);box-shadow:0 0 0 4px rgba(34,211,238,.08)}.gr-input::placeholder{color:var(--text-muted)}.gr-btn{background:linear-gradient(135deg,var(--primary),#06b6d4);color:#fff;border:none;border-radius:15px;padding:12px;font-size:14px;font-weight:900;cursor:pointer;width:100%;transition:all .2s;box-shadow:0 14px 34px rgba(139,92,246,.2)}.gr-btn:hover{transform:translateY(-1px)}#gr-form-error{color:#fecdd3;background:rgba(251,113,133,.1);border:1px solid rgba(251,113,133,.22);border-radius:12px;padding:10px;font-size:13px;text-align:center;display:none}
#gr-chat-body{display:none;flex:1;flex-direction:column;overflow:hidden}#gr-messages{position:relative;flex:1;overflow-y:auto;padding:14px;display:flex;flex-direction:column;gap:10px;scroll-behavior:smooth;background:radial-gradient(circle at 50% 0%,rgba(139,92,246,.08),transparent 44%)}#gr-messages::-webkit-scrollbar{width:5px}#gr-messages::-webkit-scrollbar-thumb{background:rgba(139,92,246,.45);border-radius:999px}.gr-msg-wrap{display:flex;flex-direction:column;max-width:88%}.gr-msg-wrap.player{align-self:flex-end;align-items:flex-end}.gr-msg-wrap.bot,.gr-msg-wrap.agent,.gr-msg-wrap.system{align-self:flex-start;align-items:flex-start}.gr-msg-label{font-size:11px;color:var(--text-muted);margin-bottom:4px;padding:0 4px;font-weight:700}.gr-msg-bubble{padding:9px 12px;border-radius:16px;font-size:13.5px;line-height:1.46;color:var(--text);word-break:break-word;max-width:100%;box-shadow:0 10px 24px rgba(0,0,0,.16)}.gr-msg-wrap.player .gr-msg-bubble{background:linear-gradient(135deg,var(--primary),#06b6d4);color:#fff;border-bottom-right-radius:5px}.gr-msg-wrap.bot .gr-msg-bubble{background:rgba(255,255,255,.075);border:1px solid rgba(148,163,184,.16);border-bottom-left-radius:5px}.gr-msg-wrap.agent .gr-msg-bubble{background:linear-gradient(135deg,#059669,#22c55e);color:#fff;border-bottom-left-radius:5px}.gr-msg-wrap.system .gr-msg-bubble{background:rgba(251,191,36,.1);border:1px solid rgba(251,191,36,.25);color:#fde68a;font-size:12.5px;border-radius:12px;text-align:center}.gr-msg-time{font-size:10px;color:var(--text-muted);padding:0 4px;margin-top:3px}
#gr-input-area{padding:10px 11px;border-top:1px solid var(--border);display:flex;flex-direction:column;gap:8px;flex-shrink:0;background:rgba(15,18,34,.96)}#gr-attach-preview{display:none;align-items:center;gap:8px;background:rgba(2,6,23,.72);border:1px solid var(--border);border-radius:14px;padding:8px 10px;font-size:12px;color:var(--text-muted)}#gr-attach-preview img{width:42px;height:42px;border-radius:8px;object-fit:cover;flex-shrink:0;display:none}#gr-preview-name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--text)}#gr-preview-clear{background:rgba(251,113,133,.15);border:none;color:#fecdd3;border-radius:8px;width:28px;height:28px;cursor:pointer;flex-shrink:0;font-size:12px}#gr-input-row{display:flex;gap:8px;align-items:flex-end}#gr-msg-input{flex:1;background:rgba(2,6,23,.72);border:1px solid var(--border);border-radius:18px;padding:10px 13px;color:var(--text);font-size:13.5px;outline:none;resize:none;max-height:90px;transition:all .2s;line-height:1.4}#gr-msg-input:focus{border-color:rgba(34,211,238,.6);box-shadow:0 0 0 4px rgba(34,211,238,.08)}#gr-msg-input::placeholder{color:var(--text-muted)}.gr-icon-btn{width:38px;height:38px;border-radius:14px;border:1px solid rgba(255,255,255,.08);cursor:pointer;display:flex;align-items:center;justify-content:center;flex-shrink:0;transition:all .2s}#gr-attach-btn{background:rgba(255,255,255,.06);color:#c4b5fd}#gr-attach-btn:hover{background:rgba(139,92,246,.2)}#gr-attach-btn svg{width:17px;height:17px}#gr-send-btn{background:linear-gradient(135deg,var(--primary),#06b6d4)}#gr-send-btn:hover{transform:translateY(-1px)}#gr-send-btn svg{width:16px;height:16px;fill:white}.gr-media-bubble{margin-bottom:6px;border-radius:12px;overflow:hidden;max-width:220px}.gr-media-bubble img{width:100%;display:block;border-radius:10px;max-height:180px;object-fit:cover}.gr-file-chip{font-size:12px;color:var(--text-muted)}.gr-attachment-only{font-size:12px;color:rgba(255,255,255,.9)!important}#gr-preview{display:none;align-items:center;gap:8px;background:rgba(2,6,23,.72);border:1px solid var(--border);border-radius:14px;padding:8px 10px}#gr-preview img{width:44px;height:44px;border-radius:8px;object-fit:cover;display:none;flex-shrink:0}#gr-preview .pv-icon{font-size:24px;flex-shrink:0}#gr-preview .pv-info{flex:1;min-width:0}#gr-preview .pv-name{font-size:12px;font-weight:800;color:var(--text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#gr-preview .pv-size{font-size:11px;color:var(--text-muted)}#gr-attach-hint{display:none;font-size:11px;color:#67e8f9;padding:0 2px}.gr-upload-progress{font-size:12px;color:var(--text-muted)}.gr-progress-bar{height:4px;background:rgba(148,163,184,.2);border-radius:999px;margin-top:6px;overflow:hidden}.gr-progress-fill{height:100%;width:0;background:linear-gradient(90deg,var(--primary),#06b6d4);transition:width .25s}.gr-file-bubble{display:flex;align-items:center;gap:8px;background:rgba(255,255,255,.06);border:1px solid var(--border);border-radius:12px;padding:8px 10px;text-decoration:none;color:var(--text)}.gr-file-bubble .fi{font-size:22px}.gr-file-bubble .fn{font-size:12px;font-weight:800}.gr-file-bubble .fs{font-size:10px;color:var(--text-muted)}#gr-lightbox{position:fixed;inset:0;background:rgba(0,0,0,.88);z-index:100000;display:none;align-items:center;justify-content:center;padding:20px}#gr-lightbox.open{display:flex}#gr-lightbox img{max-width:100%;max-height:86vh;border-radius:14px}#gr-lightbox-close{position:absolute;top:16px;right:16px;background:rgba(255,255,255,.15);border:none;color:#fff;width:36px;height:36px;border-radius:50%;cursor:pointer;font-size:18px}#gr-footer{padding:7px;text-align:center;color:var(--text-muted);font-size:11px;border-top:1px solid var(--border);background:rgba(2,6,23,.25)}#gr-footer a{color:#67e8f9;text-decoration:none;font-weight:750}.gr-msg-bubble strong{font-weight:800}.gr-msg-bubble code{background:rgba(255,255,255,.12);padding:1px 5px;border-radius:5px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:13px}
@media(max-width:920px){#gr-chat-window{width:340px;height:min(540px,calc(100vh - 112px));right:16px;bottom:84px}#gr-chat-launcher{right:16px;bottom:16px}}
@media(max-width:520px){#gr-chat-window{width:calc(100vw - 20px);right:10px;bottom:82px;height:min(560px,calc(100vh - 104px));border-radius:22px}#gr-chat-launcher{right:14px;bottom:14px;width:58px;height:58px;border-radius:20px}}
@media(max-width:480px){
  #gr-chat-window{inset:8px 8px max(8px,env(safe-area-inset-bottom)) 8px;width:auto;max-width:none;height:auto;max-height:none;border-radius:20px}
  #gr-chat-header{padding:10px 11px;gap:8px}
  #gr-header-avatar{width:34px;height:34px;border-radius:12px;font-size:17px}
  #gr-header-info h4{font-size:14px}
  #gr-header-info span{font-size:11px}
  #gr-close-btn{width:34px;height:34px;padding:0;display:grid;place-items:center}
  #gr-register-form{padding:16px 14px;gap:10px;overflow-y:auto;-webkit-overflow-scrolling:touch}
  #gr-register-form h3{font-size:18px}
  #gr-register-form p{font-size:12px}
  #gr-consent-box{padding:10px;font-size:12px}
  #gr-chat-body{min-height:0}
  #gr-messages{padding:12px;gap:9px;min-height:0;padding-bottom:max(12px,env(safe-area-inset-bottom))}
  #gr-input-area{padding:8px max(9px,env(safe-area-inset-right)) max(10px,env(safe-area-inset-bottom)) max(9px,env(safe-area-inset-left));position:sticky;bottom:0}
  #gr-input-row{gap:7px}
  .gr-icon-btn{width:40px;height:40px;border-radius:13px}
  #gr-attach-btn{background:rgba(139,92,246,.18);color:#e9d5ff;border-color:rgba(139,92,246,.28)}
  #gr-msg-input{font-size:16px;max-height:112px;padding:9px 12px}
  #gr-footer{display:none}
  #gr-chat-launcher{right:14px;bottom:max(14px,env(safe-area-inset-bottom));width:62px;height:62px;border-radius:22px}
  #gr-chat-window.gr-closed-chat #gr-input-area{opacity:.55;pointer-events:none}
}
@supports(height:100dvh){
  @media(max-width:480px){#gr-chat-window{height:auto;max-height:none;bottom:max(8px,env(safe-area-inset-bottom));}}
}
#gr-install-tip{position:fixed;right:22px;bottom:92px;left:auto;width:min(320px,calc(100vw - 44px));max-width:320px;z-index:99997;display:none;flex-direction:column;gap:12px;background:linear-gradient(180deg,rgba(18,22,40,.98),rgba(10,12,24,.98));border:1px solid rgba(139,92,246,.28);border-radius:20px;padding:14px 38px 14px 14px;box-shadow:0 20px 50px rgba(0,0,0,.4);color:var(--text);font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;animation:slideUp .25s ease}
#gr-install-tip.visible{display:flex}
.gr-install-body{display:flex;gap:12px;align-items:flex-start}
.gr-install-icon{width:40px;height:40px;border-radius:14px;background:rgba(139,92,246,.18);border:1px solid rgba(139,92,246,.22);display:grid;place-items:center;font-size:20px;flex-shrink:0}
.gr-install-text{min-width:0;flex:1}
#gr-install-tip strong{font-size:14px;font-weight:900;line-height:1.25;display:block}
#gr-install-tip p{margin:4px 0 0;color:var(--text-muted);font-size:12px;line-height:1.45}
.gr-install-actions{display:flex;justify-content:flex-end}
#gr-install-action{background:linear-gradient(135deg,var(--primary),#06b6d4);color:white;border:0;border-radius:12px;padding:9px 16px;font-size:13px;font-weight:850;cursor:pointer;flex-shrink:0}
#gr-install-close{position:absolute;top:10px;right:10px;width:26px;height:26px;border:0;border-radius:50%;background:rgba(255,255,255,.08);color:var(--text);cursor:pointer;font-size:17px;line-height:1}
@media(max-width:480px){#gr-install-tip{right:14px;left:auto;width:min(300px,calc(100vw - 28px));bottom:max(86px,calc(env(safe-area-inset-bottom) + 80px))}}

/* Host pages: standard compact chatbox on desktop; near-fullscreen on mobile */
body.lv-host-page.gr-chat-open #gr-chat-launcher{display:none}
body.lv-page-chat-now.gr-chat-open .panel{display:none}
@media(min-width:481px){
  body.lv-host-page.gr-chat-open #gr-chat-window{display:flex!important;flex-direction:column!important;position:fixed;top:auto;left:auto;right:22px;bottom:92px;width:min(380px,calc(100vw - 44px));max-width:380px;height:min(560px,calc(100vh - 124px));max-height:none;border-radius:24px;border:1px solid var(--border);animation:slideUp .22s ease}
  body.lv-host-page.gr-chat-open #gr-install-tip{display:none!important}
}
@media(max-width:480px){
  body.lv-host-page.gr-chat-open #gr-chat-window{display:flex!important;flex-direction:column!important;inset:8px 8px max(8px,env(safe-area-inset-bottom)) 8px;width:auto;max-width:none;height:auto;max-height:none;border-radius:20px}
  body.lv-host-page.gr-chat-open #gr-install-tip{display:none!important}
}
