.hstock-chat-root{--hc-primary:#635bdb;--hc-primary-2:#7855c9;--hc-accent:#665be0;--hc-admin:#299f69;--hc-ink:#1c2942;--hc-muted:#8290a8;--hc-line:#e5eaf4;--hc-surface:#fff;--hc-soft:#f5f7fc;position:relative;z-index:2000}
body.client-template-luxe .hstock-chat-root{--hc-primary:#3b82f6;--hc-primary-2:#635bdb;--hc-accent:#3e70e8;--hc-admin:#249c81}
body:not(.client-template-hstock):not(.client-template-luxe) .hstock-chat-root{--hc-primary:#496acb;--hc-primary-2:#3452a6;--hc-accent:#3968c7;--hc-admin:#2b9e70}
.hstock-chat-root{pointer-events:none}
.hstock-chat-launcher,.hstock-chat-panel{pointer-events:auto}
.hstock-chat-launcher{position:fixed;right:76px;bottom:calc(80px + env(safe-area-inset-bottom));width:48px;height:48px;border:0;border-radius:50%;background:linear-gradient(145deg,var(--hc-primary),var(--hc-primary-2));color:#fff;display:grid;place-items:center;box-shadow:0 14px 30px rgba(43,57,128,.28);cursor:pointer;transition:transform .2s ease,box-shadow .2s ease;z-index:2090}
.hstock-chat-launcher:hover,.hstock-chat-launcher:focus-visible{transform:translateY(-3px);box-shadow:0 18px 35px rgba(43,57,128,.4);outline:none}
.hstock-chat-launcher i{font-size:22px}
.hstock-chat-unread{position:absolute;right:-3px;top:-5px;min-width:21px;height:21px;padding:0 5px;border:2px solid #fff;border-radius:99px;background:#f04462;color:#fff;font-size:11px;line-height:17px;font-weight:800;display:none}
.hstock-chat-panel{position:fixed;right:76px;bottom:calc(138px + env(safe-area-inset-bottom));width:min(390px,calc(100vw - 32px));height:min(680px,calc(100dvh - 122px));min-height:460px;display:flex;flex-direction:column;overflow:hidden;border:1px solid rgba(218,224,239,.95);border-radius:22px;background:var(--hc-surface);box-shadow:0 25px 70px rgba(28,41,66,.24);z-index:2085;transform-origin:bottom right;animation:hstockChatIn .2s ease-out}
.hstock-chat-panel[hidden]{display:none}
.hstock-chat-head{display:flex;align-items:center;gap:11px;padding:16px 16px 15px;background:linear-gradient(135deg,var(--hc-primary),var(--hc-primary-2));color:#fff}
.hstock-chat-agent-avatar{width:40px;height:40px;display:grid;place-items:center;flex:0 0 auto;border:1px solid rgba(255,255,255,.42);border-radius:14px;background:rgba(255,255,255,.18);font-size:19px}
.hstock-chat-head-copy{min-width:0;flex:1}
.hstock-chat-head-copy strong{display:block;font-size:15px;line-height:1.35;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.hstock-chat-head-copy span{display:block;margin-top:3px;color:rgba(255,255,255,.78);font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.hstock-chat-head-status{display:inline-flex;align-items:center;gap:5px}
.hstock-chat-head-status:before{width:7px;height:7px;border-radius:50%;background:#55e19d;content:"";box-shadow:0 0 0 3px rgba(85,225,157,.2)}
.hstock-chat-close{width:32px;height:32px;border:0;border-radius:50%;background:rgba(255,255,255,.15);color:#fff;display:grid;place-items:center;cursor:pointer}
.hstock-chat-close:hover{background:rgba(255,255,255,.26)}
.hstock-chat-notice{margin:12px 12px 4px;padding:10px 12px;border-left:3px solid #2e9eea;border-radius:10px;background:#eef7ff;color:#52708f;font-size:12px;line-height:1.5}
.hstock-chat-notice i{margin-right:6px;color:#209bdd}
.hstock-chat-messages{display:flex;flex:1;flex-direction:column;gap:10px;overflow:auto;padding:15px 14px 12px;background:linear-gradient(180deg,#fbfcff 0%,var(--hc-soft) 100%);overscroll-behavior:contain;min-height:0;scrollbar-width:thin;scrollbar-color:#c9c7ed transparent}
.hstock-chat-messages::-webkit-scrollbar{width:6px}
.hstock-chat-messages::-webkit-scrollbar-thumb{border-radius:99px;background:#c9c7ed}
.hstock-chat-empty{margin:auto;padding:24px 18px;text-align:center;color:var(--hc-muted);font-size:13px;line-height:1.7}
.hstock-chat-empty i{display:block;margin-bottom:9px;color:#b7c0d3;font-size:28px}
.hstock-chat-bubble{max-width:84%;padding:11px 13px;border-radius:16px;color:#fff;font-size:13px;line-height:1.65;white-space:pre-wrap;overflow-wrap:anywhere;box-shadow:0 6px 14px rgba(31,48,90,.08)}
.hstock-chat-bubble.is-user{align-self:flex-end;border-bottom-right-radius:5px;background:linear-gradient(135deg,var(--hc-primary),var(--hc-primary-2))}
.hstock-chat-bubble.is-admin{align-self:flex-start;border-bottom-left-radius:5px;background:linear-gradient(135deg,var(--hc-admin),#279d65)}
.hstock-chat-bubble.is-system{align-self:center;max-width:92%;padding:7px 11px;background:#e9edf6;color:#64728d;font-size:12px;box-shadow:none}
.hstock-chat-bubble-meta{display:block;margin-top:5px;color:rgba(255,255,255,.68);font-size:10px;line-height:1;text-align:right}
.hstock-chat-bubble.is-system .hstock-chat-bubble-meta{display:none}
.hstock-chat-quick{display:flex;flex:0 0 auto;gap:7px;overflow-x:auto;padding:8px 12px;border-top:1px solid var(--hc-line);background:#fff;scrollbar-width:none}
.hstock-chat-quick::-webkit-scrollbar{display:none}
.hstock-chat-quick button{flex:0 0 auto;padding:7px 10px;border:1px solid #dfe4f0;border-radius:99px;background:#fff;color:#596884;font-size:11px;cursor:pointer;white-space:nowrap}
.hstock-chat-quick button:hover{border-color:#b6adf1;background:#f7f5ff;color:var(--hc-primary)}
.hstock-chat-connection{padding:0 14px 8px;background:#fff;color:#9aa5ba;font-size:10px;text-align:right}
.hstock-chat-connection.is-live{color:#23a66d}
.hstock-chat-attachment{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:0 12px;padding:8px 10px;border:1px solid #dfe4f4;border-radius:11px;background:#f7f8fd;color:#63718d;font-size:11px}
.hstock-chat-attachment[hidden]{display:none}
.hstock-chat-attachment span{display:flex;align-items:center;min-width:0;gap:7px}
.hstock-chat-attachment span i{color:var(--hc-accent)}
.hstock-chat-attachment strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:600}
.hstock-chat-attachment button{width:24px;height:24px;flex:0 0 auto;border:0;border-radius:8px;background:#ecebfb;color:#6b61c9;cursor:pointer}
.hstock-chat-compose{display:flex;align-items:flex-end;gap:8px;flex:0 0 auto;padding:10px 12px calc(12px + env(safe-area-inset-bottom));border-top:1px solid var(--hc-line);background:#fff}
.hstock-chat-attach{width:40px;height:40px;flex:0 0 auto;border:1px solid #dce2ee;border-radius:12px;background:#f8f9fc;color:var(--hc-accent);display:grid;place-items:center;cursor:pointer}
.hstock-chat-attach:hover{border-color:#9d94e9;background:#f7f5ff}
.hstock-chat-input{min-height:40px;max-height:110px;flex:1;resize:none;padding:11px 12px;border:1px solid #dce2ee;border-radius:12px;background:#f8f9fc;color:var(--hc-ink);font:inherit;font-size:13px;line-height:1.4;outline:none}
.hstock-chat-input:focus{border-color:#9d94e9;background:#fff;box-shadow:0 0 0 3px rgba(99,91,219,.1)}
.hstock-chat-send{width:42px;height:40px;border:0;border-radius:12px;background:linear-gradient(145deg,var(--hc-primary),var(--hc-primary-2));color:#fff;display:grid;place-items:center;cursor:pointer;box-shadow:0 7px 15px rgba(99,91,219,.22)}
.hstock-chat-send:disabled{opacity:.55;cursor:not-allowed;box-shadow:none}
.hstock-chat-bubble a{display:block;color:inherit;text-decoration:none}
.hstock-chat-bubble img{display:block;width:min(220px,100%);max-height:260px;object-fit:cover;border-radius:11px;background:rgba(255,255,255,.18)}
.hstock-chat-bubble.is-image{padding:7px}
.hstock-chat-bubble.is-image .hstock-chat-bubble-meta{padding:0 5px 1px}
.hstock-header-chat{background:linear-gradient(145deg,var(--hc-primary),var(--hc-primary-2))}
.hstock-chat-root.has-site-message-right .hstock-chat-launcher{right:132px}
.hstock-chat-root.has-site-message-left .hstock-chat-launcher{left:76px;right:auto}
.hstock-chat-root.no-site-message-float .hstock-chat-launcher{right:20px}
html.hstock-dark-mode .hstock-chat-panel,body.hstock-dark-mode .hstock-chat-panel{--hc-surface:#20283b;--hc-ink:#edf2ff;--hc-muted:#a8b4cb;--hc-line:#344058;--hc-soft:#283148}
html.hstock-dark-mode .hstock-chat-notice,html.hstock-dark-mode .hstock-chat-quick,html.hstock-dark-mode .hstock-chat-compose,html.hstock-dark-mode .hstock-chat-connection,body.hstock-dark-mode .hstock-chat-notice,body.hstock-dark-mode .hstock-chat-quick,body.hstock-dark-mode .hstock-chat-compose,body.hstock-dark-mode .hstock-chat-connection{background:#20283b}
html.hstock-dark-mode .hstock-chat-messages,body.hstock-dark-mode .hstock-chat-messages{background:linear-gradient(180deg,#1d2537 0%,#171e2e 100%)}
html.hstock-dark-mode .hstock-chat-quick button,body.hstock-dark-mode .hstock-chat-quick button{border-color:#3e4962;background:#273149;color:#d3dbed}
html.hstock-dark-mode .hstock-chat-input,body.hstock-dark-mode .hstock-chat-input{border-color:#3e4962;background:#273149;color:#edf2ff}
@keyframes hstockChatIn{from{opacity:0;transform:translateY(10px) scale(.97)}to{opacity:1;transform:translateY(0) scale(1)}}
@keyframes hstockChatMobileIn{from{opacity:0;transform:translateY(24px)}to{opacity:1;transform:translateY(0)}}
@media(max-width:800px){
  .hstock-chat-launcher{right:72px;bottom:calc(24px + env(safe-area-inset-bottom));width:42px;height:42px;border-radius:50%}
  .hstock-chat-launcher i{font-size:15px}
  .hstock-chat-panel{right:12px;bottom:calc(76px + env(safe-area-inset-bottom));width:min(420px,calc(100vw - 24px));height:min(640px,calc(100dvh - 148px));min-height:420px;border-radius:22px;box-shadow:0 18px 48px rgba(28,41,66,.26);animation:hstockChatMobileIn .22s ease-out}
  .hstock-chat-messages{padding-bottom:14px}
  .hstock-chat-compose{padding-bottom:calc(12px + env(safe-area-inset-bottom))}
  .hstock-chat-root.has-site-message-right .hstock-chat-launcher{right:124px}
  .hstock-chat-root.has-site-message-left .hstock-chat-launcher{left:72px;right:auto}
}
@media(max-width:520px){
  .hstock-chat-panel{right:10px;bottom:calc(76px + env(safe-area-inset-bottom));width:calc(100vw - 20px);height:min(600px,calc(100dvh - 132px));min-height:380px;border-radius:20px}
  .hstock-chat-head{padding:13px 13px 12px}
  .hstock-chat-agent-avatar{width:36px;height:36px;border-radius:12px}
  .hstock-chat-bubble{max-width:88%;font-size:12px}
  .hstock-chat-compose{gap:6px;padding-left:10px;padding-right:10px}
  .hstock-chat-attach{width:38px;height:40px}
  .hstock-chat-send{width:40px}
}
@media(max-height:620px){.hstock-chat-panel{bottom:calc(64px + env(safe-area-inset-bottom));height:calc(100dvh - 96px);min-height:0}}
body.client-template-hstock .hstock-chat-launcher{right:76px;bottom:calc(80px + env(safe-area-inset-bottom));width:48px;height:48px;border-radius:50%}
body.client-template-hstock .hstock-chat-launcher i{font-size:17px}
body.client-template-hstock .hstock-chat-panel{bottom:calc(138px + env(safe-area-inset-bottom))}
body.client-template-hstock .hstock-chat-root.has-site-message-right .hstock-chat-launcher{right:132px}
body.client-template-hstock .hstock-chat-root.has-site-message-left .hstock-chat-launcher{left:76px;right:auto}
body.client-template-hstock .hstock-chat-root.no-site-message-float .hstock-chat-launcher{right:20px}
.hstock-chat-root.has-leaderboard.no-site-message-float .hstock-chat-launcher{right:76px}
@media(max-width:800px){
  body.client-template-hstock .hstock-chat-launcher{right:72px;bottom:calc(24px + env(safe-area-inset-bottom));width:42px;height:42px;border-radius:50%}
  body.client-template-hstock .hstock-chat-launcher i{font-size:15px}
  body.client-template-hstock .hstock-chat-root.has-site-message-right .hstock-chat-launcher{right:124px}
  body.client-template-hstock .hstock-chat-root.has-site-message-left .hstock-chat-launcher{left:72px;right:auto}
  body.client-template-hstock .hstock-chat-root.no-site-message-float .hstock-chat-launcher{right:20px}
  .hstock-chat-root.has-leaderboard.no-site-message-float .hstock-chat-launcher{right:72px}
  body.client-template-hstock .hstock-chat-panel{bottom:calc(76px + env(safe-area-inset-bottom))}
}
@media(max-height:620px){body.client-template-hstock .hstock-chat-panel{bottom:calc(64px + env(safe-area-inset-bottom));height:calc(100dvh - 96px);min-height:0}}
@media(max-width:800px){
  body.hstock-chat-open .hstock-chat-launcher,
  body.hstock-chat-open .site-messages-float,
  body.hstock-chat-open .leaderboard-btn{
    opacity:0!important;
    visibility:hidden!important;
    pointer-events:none!important;
    transform:scale(.86)!important;
  }
}
