/* Market Wizards landing chat widget — scoped to #mw-chat-root */
#mw-chat-root{
  --mwc-bg:#09090b;--mwc-bg2:#111114;--mwc-card:#16161a;--mwc-line:#27272e;
  --mwc-text:#f5f3ee;--mwc-muted:#a6a6b0;--mwc-accent:#b89b5e;--mwc-accent-hi:#cbb27a;
  --mwc-font:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
  font-family:var(--mwc-font);
  color:var(--mwc-text);
  pointer-events:none;
}
#mw-chat-root *{box-sizing:border-box}
#mw-chat-root button,#mw-chat-root input,#mw-chat-root textarea{font-family:inherit}
#mw-chat-root .mw-chat-launcher,
#mw-chat-root .mw-chat-panel{pointer-events:auto}

.mw-chat-launcher{
  position:fixed;right:20px;bottom:20px;z-index:80;
  width:58px;height:58px;padding:0;border:none;border-radius:50%;
  display:inline-flex;align-items:center;justify-content:center;
  cursor:pointer;
  background:var(--mwc-accent);color:#09090b;
  box-shadow:0 8px 26px rgba(0,0,0,.45),0 0 0 1px rgba(184,155,94,.35);
  transition:transform .15s,box-shadow .15s,background .15s;
}
.mw-chat-launcher:hover{
  background:var(--mwc-accent-hi);
  transform:translateY(-2px) scale(1.04);
  box-shadow:0 12px 32px rgba(184,155,94,.32),0 0 0 1px rgba(203,178,122,.55);
}
.mw-chat-launcher:focus-visible{outline:2px solid var(--mwc-accent-hi);outline-offset:3px}
.mw-chat-launcher[aria-expanded="true"]{background:var(--mwc-accent);color:#09090b}
.mw-chat-launcher[aria-expanded="true"]:hover{background:var(--mwc-accent-hi)}
.mw-chat-launcher svg{width:26px;height:26px;flex:none;display:block}
.mw-chat-launcher .mw-chat-icon-close{display:none}
.mw-chat-launcher[aria-expanded="true"] .mw-chat-icon-chat{display:none}
.mw-chat-launcher[aria-expanded="true"] .mw-chat-icon-close{display:block}
.mw-chat-unread{
  position:absolute;top:2px;right:2px;width:12px;height:12px;border-radius:50%;
  background:#e8b4b4;border:2px solid var(--mwc-bg);box-shadow:0 0 0 1px rgba(232,180,180,.4);
  pointer-events:none;
}
.mw-chat-unread[hidden]{display:none}

.mw-chat-panel{
  position:fixed;right:20px;bottom:84px;z-index:80;
  width:360px;height:520px;max-height:calc(100vh - 120px);
  display:flex;flex-direction:column;
  background:var(--mwc-card);color:var(--mwc-text);
  border:1px solid var(--mwc-line);border-radius:16px;
  box-shadow:0 24px 60px rgba(0,0,0,.55);
  overflow:hidden;padding:0 !important;
}
.mw-chat-panel[hidden]{display:none !important}

.mw-chat-head{
  display:flex;align-items:center;gap:10px;padding:12px 12px 12px 16px;
  border-bottom:1px solid var(--mwc-line);background:var(--mwc-bg2);flex:none;
}
.mw-chat-head h2{font-size:15px;font-weight:600;margin:0;letter-spacing:.01em}
.mw-chat-head p{margin:2px 0 0;font-size:12px;color:var(--mwc-muted);font-weight:400}
.mw-chat-close{
  margin-left:auto;background:none;border:0;color:var(--mwc-muted);cursor:pointer;
  width:36px;height:36px;border-radius:8px;display:inline-flex;align-items:center;justify-content:center;
}
.mw-chat-close:hover{color:var(--mwc-text);background:rgba(245,243,238,.06)}
.mw-chat-close:focus-visible{outline:2px solid var(--mwc-accent);outline-offset:2px}
.mw-chat-close svg{width:18px;height:18px}

.mw-chat-log{
  flex:1 1 auto;min-height:0;overflow-y:auto;padding:14px 14px 8px;display:flex;flex-direction:column;gap:10px;
  background:var(--mwc-bg);
}
.mw-chat-greeting,.mw-chat-notice,.mw-chat-offline{
  font-size:13.5px;line-height:1.5;color:var(--mwc-muted);padding:10px 12px;border-radius:10px;
  background:rgba(184,155,94,.08);border:1px solid rgba(184,155,94,.22);
}
.mw-chat-offline{background:rgba(239,68,68,.1);border-color:rgba(239,68,68,.28);color:#fca5a5}
.mw-chat-notice{color:var(--mwc-accent-hi)}

.mw-chat-bubble{max-width:88%;display:flex;flex-direction:column;gap:3px}
.mw-chat-bubble.is-visitor{align-self:flex-end}
.mw-chat-bubble.is-admin{align-self:flex-start}
.mw-chat-bubble .mw-chat-body{
  padding:9px 12px;border-radius:12px;font-size:13.5px;line-height:1.5;white-space:pre-wrap;word-break:break-word;
}
.mw-chat-bubble.is-visitor .mw-chat-body{background:var(--mwc-accent);color:#09090b;border-bottom-right-radius:4px}
.mw-chat-bubble.is-admin .mw-chat-body{background:var(--mwc-bg2);border:1px solid var(--mwc-line);color:var(--mwc-text);border-bottom-left-radius:4px}
.mw-chat-meta{font-size:11px;color:var(--mwc-muted);padding:0 4px}
.mw-chat-bubble.is-visitor .mw-chat-meta{text-align:right}

.mw-chat-typing{display:inline-flex;gap:4px;align-items:center;padding:10px 12px;border-radius:12px;background:var(--mwc-bg2);border:1px solid var(--mwc-line);align-self:flex-start}
.mw-chat-typing[hidden]{display:none !important}
.mw-chat-typing i{width:6px;height:6px;border-radius:50%;background:var(--mwc-accent);opacity:.4;animation:mwc-dot 1s infinite}
.mw-chat-typing i:nth-child(2){animation-delay:.15s}
.mw-chat-typing i:nth-child(3){animation-delay:.3s}
@keyframes mwc-dot{0%,80%,100%{opacity:.3;transform:translateY(0)}40%{opacity:1;transform:translateY(-2px)}}

.mw-chat-compose{flex:none;padding:10px 12px 12px;border-top:1px solid var(--mwc-line);background:var(--mwc-card);display:grid;gap:8px;z-index:1}
.mw-chat-fields{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.mw-chat-compose input,.mw-chat-compose textarea{
  width:100%;background:var(--mwc-bg2);border:1px solid var(--mwc-line);border-radius:9px;
  padding:9px 11px;color:var(--mwc-text);font-size:13.5px;outline:none;
}
.mw-chat-compose input:focus,.mw-chat-compose textarea:focus{border-color:var(--mwc-accent);box-shadow:0 0 0 3px rgba(184,155,94,.16)}
.mw-chat-compose textarea{min-height:72px;resize:none;line-height:1.45}
.mw-chat-hp{position:absolute;left:-9999px;height:0;width:0;overflow:hidden}
.mw-chat-hint{font-size:11.5px;color:var(--mwc-muted);line-height:1.4}
.mw-chat-row{display:flex;align-items:center;gap:8px}
.mw-chat-count{margin-left:auto;font-size:11px;color:var(--mwc-muted)}
.mw-chat-send{
  background:var(--mwc-accent);color:#09090b;border:0;border-radius:9px;padding:9px 14px;
  font-weight:600;font-size:13px;cursor:pointer;flex:none;
}
.mw-chat-send:hover{background:var(--mwc-accent-hi)}
.mw-chat-send:disabled{opacity:.55;cursor:not-allowed}
.mw-chat-send:focus-visible{outline:2px solid var(--mwc-accent-hi);outline-offset:2px}


@media (max-width:720px){
  .mw-chat-launcher{right:20px;bottom:20px}
  .mw-chat-panel{
    left:0;right:0;bottom:0;top:auto;width:100%;
    height:min(92vh,640px);max-height:92vh;
    border-radius:16px 16px 0 0;border-left:0;border-right:0;border-bottom:0;
  }
  .mw-chat-fields{grid-template-columns:1fr}
  /* Keep the signup submit button clear of the launcher */
  #signup{padding-bottom:72px}
  footer{padding-bottom:88px}
}
