:root{--rfb-brand:#111827}
/* Base light styles */
.rfb-box{font-family:system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,'Helvetica Neue',Arial,sans-serif;background:#fff;border:1px solid #e5e7eb;border-radius:16px;box-shadow:0 6px 24px rgba(0,0,0,.08);max-width:720px}
.rfb-header{display:flex;align-items:center;gap:8px;border-bottom:1px solid #f3f4f6;padding:10px 12px}
.rfb-htitle{font-weight:700;color:#111827}
.rfb-htext{color:#6b7280;font-size:13px}
.rfb-clear{margin-left:auto;border:1px solid #e5e7eb;border-radius:9999px;background:#fff;color:#111827;padding:6px 10px;cursor:pointer}

.rfb-msgs{max-height:420px;overflow:auto;padding:12px 12px 0}
.rfb-form{display:flex;gap:8px;padding:12px;border-top:1px solid #f3f4f6}
.rfb-input-wrap{position:relative;flex:1}
.rfb-input{width:100%;border:1px solid #e5e7eb;border-radius:9999px;padding:10px 14px;color:#111827;background:#fff}
.rfb-send{border:none;border-radius:9999px;padding:10px 14px;background:var(--rfb-brand);color:#fff;cursor:pointer}

.rfb-autocomplete{position:absolute;left:0;right:0;top:100%;z-index:10;background:#fff;border:1px solid #e5e7eb;border-radius:12px;margin-top:6px;box-shadow:0 6px 24px rgba(0,0,0,.1)}
.rfb-opt{padding:8px 10px;cursor:pointer;color:#111827}
.rfb-opt:hover{background:#f9fafb}

.rfb-suggestions{display:flex;flex-wrap:wrap;gap:8px;margin:8px 0}
.rfb-sugg{background:#f3f4f6;color:#111827;border:1px solid #e5e7eb;border-radius:9999px;padding:6px 10px;cursor:pointer;line-height:1.2}
.rfb-sugg:hover{background:#e5e7eb}

.rfb-bubble{max-width:85%;padding:10px 12px;border-radius:14px;margin:8px 0;line-height:1.35}
.rfb-user{margin-left:auto;background:var(--rfb-brand);color:#fff}
.rfb-bot{margin-right:auto;background:#f3f4f6;color:#1f2937!important}

.rfb-typing{display:inline-flex;gap:6px;padding:8px 10px}
.rfb-typing span{width:6px;height:6px;border-radius:50%;background:#9ca3af;animation:rfbBlink 1.2s infinite ease-in-out}
.rfb-typing .d2{animation-delay:.2s}.rfb-typing .d3{animation-delay:.4s}
@keyframes rfbBlink{0%,80%,100%{opacity:.2}40%{opacity:1}}

/* Answer cards */
.rfb-ans{border:1px solid #e5e7eb;border-radius:12px;padding:10px;margin:6px 0;background:#fff}
.rfb-ans-head{display:flex;align-items:center;gap:8px}
.rfb-ans-title{font-weight:600;color:#111827;flex:1}
.rfb-togg{border:1px solid #e5e7eb;border-radius:9999px;background:#fff;color:#111827;padding:4px 10px;cursor:pointer}
.rfb-ans-body{font-size:14px;color:#1f2937;margin-top:8px}
.rfb-ans-body a{ text-decoration: underline; }
.rfb-light .rfb-ans-body a{ color: var(--rfb-brand) !important; }
.rfb-dark .rfb-ans-body a{ color:#93c5fd !important; }
/* .rfb-more intentionally hidden in 0.3.3 */
.rfb-more{display:none !important;}
.rfb-fb{display:flex;gap:8px;margin-top:8px}
.rfb-fb button{border:1px solid #e5e7eb;border-radius:9999px;background:#fff;color:#111827;padding:4px 10px;cursor:pointer}
.rfb-fb button.rfb-pop{ animation: rfbPop .25s ease-out both; }
@keyframes rfbPop { 0%{ transform: scale(1); opacity:1;} 50%{ transform: scale(1.12); opacity:0.95;} 100%{ transform: scale(1); opacity:1;} }

/* Floating bubble */
.rfb-floating{position:fixed;right:16px;bottom:16px;z-index:99999}
.rfb-fab{width:56px;height:56px;border-radius:50%;background:var(--rfb-brand);box-shadow:0 6px 24px rgba(0,0,0,.22);cursor:pointer;position:relative;transition:transform .15s ease, box-shadow .15s ease}
.rfb-fab::before{content:'❓';color:#fff;position:absolute;inset:0;display:grid;place-items:center;font-size:24px}
.rfb-fab:hover{transform:translateY(-1px);box-shadow:0 10px 28px rgba(0,0,0,.28)}
.rfb-panel{position:absolute;right:0;bottom:72px;background:#fff;border:1px solid #e5e7eb;border-radius:16px;box-shadow:0 6px 24px rgba(0,0,0,.22);padding:12px;width:min(92vw,420px);opacity:0;transform:translateY(8px);pointer-events:none;transition:opacity .2s ease, transform .2s ease}
.rfb-panel.open{opacity:1;transform:translateY(0);pointer-events:auto}

/* Light theme explicit overrides */
.rfb-light .rfb-htitle,
.rfb-light .rfb-htext,
.rfb-light .rfb-input,
.rfb-light .rfb-opt,
.rfb-light .rfb-sugg,
.rfb-light .rfb-bot,
.rfb-light .rfb-ans-title,
.rfb-light .rfb-togg,
.rfb-light .rfb-ans-body,
.rfb-light .rfb-more,
.rfb-light .rfb-fb button,
.rfb-light .rfb-clear { color:#111827 !important; }

/* Dark theme */
.rfb-dark .rfb-box{background:#0b0f19;border-color:#1f2937;box-shadow:0 6px 24px rgba(0,0,0,.6)}
.rfb-dark .rfb-header{border-bottom-color:#1f2937}
.rfb-dark .rfb-htitle{color:#e5e7eb}
.rfb-dark .rfb-htext{color:#9ca3af}
.rfb-dark .rfb-clear{background:#0b0f19;color:#e5e7eb;border-color:#1f2937}

.rfb-dark .rfb-input{background:#0f1523;border-color:#1f2937;color:#e5e7eb}
.rfb-dark .rfb-send{background:var(--rfb-brand);color:#fff}

.rfb-dark .rfb-autocomplete{background:#0b0f19;border-color:#1f2937;box-shadow:0 6px 24px rgba(0,0,0,.6)}
.rfb-dark .rfb-opt{color:#e5e7eb}
.rfb-dark .rfb-opt:hover{background:#111827}

.rfb-dark .rfb-sugg{background:#111827;color:#e5e7eb;border-color:#1f2937}
.rfb-dark .rfb-sugg:hover{background:#162033}

.rfb-dark .rfb-bot{background:#111827;color:#e5e7eb}
.rfb-dark .rfb-typing span{background:#6b7280}

.rfb-dark .rfb-ans{background:#0b0f19;border-color:#1f2937}
.rfb-dark .rfb-ans-title{color:#e5e7eb}
.rfb-dark .rfb-togg{background:#0b0f19;border-color:#1f2937;color:#e5e7eb}
.rfb-dark .rfb-ans-body{color:#d1d5db}
.rfb-dark .rfb-more{border-color:#1f2937;color:#e5e7eb}

@keyframes rfbFadeIn { from { opacity:0; transform: translateY(4px); } to { opacity:1; transform: translateY(0); } }
.rfb-fade { animation: rfbFadeIn .18s ease both; }
