#fx-chat-btn, #fx-chat-panel { position:fixed; right:1rem; z-index:950; font-family:inherit; }
#fx-chat-btn { bottom:5rem; padding:.7rem 1rem; border:1px solid var(--fxmd-cyan,#00e5ff); border-radius:2rem; background:var(--fxmd-cta-gradient,linear-gradient(135deg, var(--fxmd-cyan,#00e5ff), var(--fxmd-mint,#00ff9c))); color:var(--fxmd-cta-ink,#061014); font-weight:700; cursor:pointer; }
#fx-chat-panel { bottom:8.5rem; width:min(28rem,calc(100vw - 2rem)); max-height:calc(100dvh - 10rem); display:flex; flex-direction:column; background:var(--fxmd-page-bg,#0d1117); color:var(--fxmd-text,#cdd9e5); border:1px solid var(--fxmd-border,#30363d); border-radius:1rem; box-shadow:var(--fxmd-panel-shadow,0 24px 64px rgba(0, 0, 0, 0.42)); overflow:hidden; font-size:.875rem; }
#fx-chat-panel[hidden] { display:none; }
.fx-chat-header { display:flex; align-items:center; gap:.5rem; padding:.6rem 1rem; background:var(--fxmd-surface,#161b22); }
.fx-chat-header strong { margin-right:auto; color:var(--fxmd-text-strong,#f0f6fc); }
#fx-chat-panel button { cursor:pointer; border:1px solid var(--fxmd-border,#30363d); border-radius:.5rem; background:var(--fxmd-surface-raised,#21262d); color:var(--fxmd-text-strong,#f0f6fc); padding:.3rem .5rem; font-size:.78rem; }
#fx-chat-panel button:disabled { opacity:.55; cursor:wait; }
#fx-chat-panel :focus-visible, #fx-chat-btn:focus-visible { outline:2px solid var(--fxmd-cyan,#00e5ff); outline-offset:2px; }
.fx-chat-intro { margin:0; padding:.5rem 1rem .2rem; font-size:.75rem; line-height:1.45; color:var(--fxmd-text,#cdd9e5); }
.fx-chat-privacy { margin:0; padding:.4rem 1rem .6rem; font-size:.68rem; line-height:1.4; opacity:.75; }
#fx-chat-messages { overflow:auto; min-height:3rem; padding:0 1rem; flex:1; overscroll-behavior:contain; }
.fx-chat-message { background:var(--fxmd-surface,#161b22); padding:.55rem .7rem; border-radius:.6rem; margin:.4rem 0; max-width:92%; white-space:pre-wrap; overflow-wrap:anywhere; line-height:1.55; }
.fx-chat-message-user { margin-left:auto; max-width:80%; background:var(--fxmd-surface-raised,#21262d); color:var(--fxmd-text-strong,#f0f6fc); }
.fx-chat-message-assistant { border:1px solid var(--fxmd-border,#30363d); }
.fx-chat-message details { margin-top:.75rem; }
.fx-chat-message summary { color:var(--fxmd-cyan,#00e5ff); cursor:pointer; }
.fx-chat-sources { display:flex; flex-wrap:wrap; gap:.5rem; margin-top:.5rem; font-size:.75rem; }
#fx-chat-panel a { color:var(--fxmd-cyan,#00e5ff); text-decoration:underline; }
#fx-chat-suggestions { display:flex; flex-wrap:wrap; gap:.3rem; padding:.4rem 1rem .6rem; }
#fx-chat-panel #fx-chat-suggestions button { font-size:.72rem; padding:.25rem .5rem; border-radius:1rem; background:transparent; color:var(--fxmd-text,#cdd9e5); }
#fx-chat-form { padding:.55rem 1rem; border-top:1px solid var(--fxmd-border,#30363d); }
#fx-chat-form label { display:block; margin-bottom:.3rem; font-size:.75rem; }
#fx-chat-input { box-sizing:border-box; width:100%; resize:vertical; max-height:6rem; border-radius:.5rem; border:1px solid var(--fxmd-border,#30363d); background:var(--fxmd-surface,#161b22); color:var(--fxmd-text-strong,#f0f6fc); padding:.5rem; font:inherit; }
#fx-chat-input::placeholder { color:var(--fxmd-text-muted,#8b949e); }
.fx-chat-actions { display:flex; align-items:center; justify-content:space-between; margin-top:.5rem; font-size:.75rem; }
#fx-chat-panel #fx-chat-send { background:var(--fxmd-cta-gradient,linear-gradient(135deg, var(--fxmd-cyan,#00e5ff), var(--fxmd-mint,#00ff9c))); color:var(--fxmd-cta-ink,#061014); font-weight:700; }
/* The open navigation menu lives inside the sticky navbar at z-index 50 and
   this launcher is fixed at 950, so it floats over the menu's own sign-in and
   trial buttons -- on a 375px viewport it covers the primary CTA outright.
   The menu is the active surface while it is open, so yield to it. #menu-btn
   carries the state for both the mobile menu and the desktop compact
   fallback, which is why this keys off aria-expanded rather than a width. */
body:has(#menu-btn[aria-expanded="true"]) #fx-chat-btn,
body:has(#menu-btn[aria-expanded="true"]) #fx-chat-panel { display:none; }

@media(max-width:480px) { #fx-chat-panel { bottom:1rem; max-height:calc(100dvh - 2rem); } #fx-chat-btn { bottom:5rem; } }

