.r2g-ai{max-width:540px;border:1px solid #d7e8db;border-radius:16px;overflow:hidden;background:#fff;box-shadow:0 8px 25px #163d2514;font-family:inherit}.r2g-ai header{background:#174a2b;color:#fff;padding:18px;display:flex;flex-direction:column;gap:3px}.r2g-ai header small{color:#d8f5df}.r2g-ai-messages{height:350px;overflow:auto;padding:16px;display:flex;flex-direction:column;gap:12px}.r2g-ai-messages p{white-space:pre-wrap;max-width:88%;margin:0;padding:11px 14px;border-radius:14px;line-height:1.5}.r2g-ai-bot{align-self:flex-start;background:#edf6ef;color:#173b23}.r2g-ai-user{align-self:flex-end;background:#25783d;color:#fff}.r2g-ai-messages a{font-size:14px;color:#186438}.r2g-ai-form{display:flex;gap:8px;padding:12px;border-top:1px solid #eee}.r2g-ai-form input{flex:1;min-width:0;border:1px solid #cbd5cc;border-radius:9px;padding:11px}.r2g-ai-form button{background:#25783d;color:#fff;border:0;border-radius:9px;padding:0 17px;cursor:pointer}.r2g-ai-form button:disabled{opacity:.5}.r2g-ai-disclaimer{padding:0 14px 12px;margin:0;color:#607063;font-size:11px}

.r2g-ai-float{position:fixed;right:20px;bottom:20px;z-index:999999;font-family:Arial,sans-serif}
.r2g-ai-launcher{border:0;border-radius:999px;background:#137c4a;color:#fff;padding:14px 20px;font-size:15px;font-weight:700;box-shadow:0 4px 18px #0003;cursor:pointer}
.r2g-ai-launcher:focus-visible,.r2g-ai-close:focus-visible{outline:3px solid #e5b93c;outline-offset:2px}
.r2g-ai-panel{position:absolute;right:0;bottom:64px;width:min(380px,calc(100vw - 28px));max-height:min(620px,calc(100dvh - 110px));overflow:auto;background:#fff;border-radius:16px;box-shadow:0 8px 35px #0004}
.r2g-ai-panel[hidden]{display:none!important}
.r2g-ai-panel .r2g-ai{width:100%;margin:0}
.r2g-ai-close{position:absolute;right:8px;top:8px;z-index:2;background:#fff;border:1px solid #ddd;border-radius:50%;width:30px;height:30px;font-size:23px;cursor:pointer;color:#222}
@media(max-width:480px){.r2g-ai-float{right:12px;bottom:12px}.r2g-ai-panel{bottom:62px}}

#r2g-ai-floating{position:fixed!important;right:16px!important;bottom:16px!important;z-index:2147483000!important;overflow:visible!important;visibility:visible!important;opacity:1!important}
#r2g-ai-panel{position:absolute!important;right:0!important;bottom:64px!important;z-index:2147483001!important;width:min(380px,calc(100vw - 32px))!important;background:#fff!important;visibility:visible!important;opacity:1!important}
#r2g-ai-panel[hidden]{display:none!important}

/* v1.7: keep all chat sections inside a compact, responsive floating panel */
html body #r2g-ai-floating #r2g-ai-panel{
 box-sizing:border-box!important;position:absolute!important;top:auto!important;
 right:0!important;left:auto!important;bottom:66px!important;
 width:min(390px,calc(100vw - 24px))!important;
 height:min(570px,calc(100dvh - 105px))!important;
 max-height:calc(100dvh - 105px)!important;
 min-height:0!important;overflow:hidden!important;
 border:1px solid #dce9df!important;border-radius:16px!important;
 background:#fff!important;box-shadow:0 12px 40px #102b1c45!important;
 padding:0!important;margin:0!important;
}
html body #r2g-ai-floating #r2g-ai-panel[hidden]{display:none!important}
html body #r2g-ai-floating #r2g-ai-panel:not([hidden]){display:flex!important;flex-direction:column!important}
html body #r2g-ai-floating #r2g-ai-panel .r2g-ai{
 display:flex!important;flex-direction:column!important;
 flex:1 1 auto!important;min-height:0!important;max-height:100%!important;
 width:100%!important;max-width:none!important;
 margin:0!important;padding:0!important;overflow:hidden!important;
 border:0!important;border-radius:0!important;box-shadow:none!important;
 background:#fff!important;box-sizing:border-box!important;
}
html body #r2g-ai-floating #r2g-ai-panel .r2g-ai>header{
 position:relative!important;top:auto!important;left:auto!important;right:auto!important;
 display:flex!important;flex:0 0 auto!important;flex-direction:column!important;
 align-items:flex-start!important;justify-content:center!important;
 min-height:74px!important;height:auto!important;
 margin:0!important;padding:14px 48px 14px 16px!important;
 background:#174a2b!important;color:#fff!important;box-sizing:border-box!important;
 border:0!important;transform:none!important;
}
html body #r2g-ai-floating #r2g-ai-panel .r2g-ai>header strong{color:#fff!important;font-size:16px!important;line-height:1.4!important}
html body #r2g-ai-floating #r2g-ai-panel .r2g-ai>header small{color:#d8f5df!important;font-size:12px!important}
html body #r2g-ai-floating #r2g-ai-panel .r2g-ai-messages{
 display:flex!important;flex:1 1 auto!important;flex-direction:column!important;
 min-height:0!important;height:auto!important;overflow-y:auto!important;
 padding:14px!important;margin:0!important;box-sizing:border-box!important;
}
html body #r2g-ai-floating #r2g-ai-panel .r2g-ai-form{
 position:relative!important;display:flex!important;flex:0 0 auto!important;
 width:100%!important;min-height:60px!important;
 margin:0!important;padding:10px!important;gap:8px!important;
 background:#fff!important;box-sizing:border-box!important;
}
html body #r2g-ai-floating #r2g-ai-panel .r2g-ai-form input{
 display:block!important;flex:1 1 auto!important;min-width:0!important;
 width:auto!important;height:42px!important;margin:0!important;
 padding:8px 10px!important;font-size:14px!important;box-sizing:border-box!important;
}
html body #r2g-ai-floating #r2g-ai-panel .r2g-ai-form button{
 display:block!important;flex:0 0 auto!important;height:42px!important;
 padding:0 15px!important;margin:0!important;line-height:42px!important;
 background:#25783d!important;color:#fff!important;
}
html body #r2g-ai-floating #r2g-ai-panel .r2g-ai-disclaimer{
 display:block!important;flex:0 0 auto!important;
 max-height:64px!important;overflow-y:auto!important;
 margin:0!important;padding:4px 12px 10px!important;
 font-size:10px!important;line-height:1.35!important;
 background:#fff!important;box-sizing:border-box!important;
}
html body #r2g-ai-floating #r2g-ai-panel .r2g-ai-close{
 position:absolute!important;top:12px!important;right:12px!important;
 z-index:100!important;display:flex!important;align-items:center!important;justify-content:center!important;
 width:30px!important;height:30px!important;padding:0!important;
 background:#fff!important;color:#174a2b!important;border-radius:50%!important;
}
@media(max-width:600px){
 html body #r2g-ai-floating #r2g-ai-panel{
  height:min(530px,calc(100dvh - 95px))!important;bottom:62px!important;
 }
}

/* v1.8: restore proper flex layout, prevent theme clipping of input/actions */
html body #r2g-ai-floating #r2g-ai-panel:not([hidden]){display:flex!important;flex-direction:column!important}
html body #r2g-ai-floating #r2g-ai-panel .r2g-ai{box-sizing:border-box!important;min-width:0!important}
html body #r2g-ai-floating #r2g-ai-panel .r2g-ai-form{box-sizing:border-box!important;min-width:0!important;max-width:100%!important;overflow:visible!important;flex-wrap:nowrap!important;align-items:center!important}
html body #r2g-ai-floating #r2g-ai-panel .r2g-ai-form input{min-width:0!important;max-width:100%!important;box-sizing:border-box!important;flex:1 1 0%!important}
html body #r2g-ai-floating #r2g-ai-panel .r2g-ai-form button{position:static!important;min-width:64px!important;max-width:90px!important;width:70px!important;flex:0 0 70px!important;box-sizing:border-box!important;white-space:nowrap!important;overflow:visible!important}
html body #r2g-ai-floating #r2g-ai-panel .r2g-ai-disclaimer{max-width:100%!important;overflow-wrap:anywhere!important}

/* v2.4 knowledge guide navigation */
html body #r2g-ai-floating .r2g-ai-topics{display:flex!important;flex:0 0 auto!important;gap:5px!important;padding:8px 10px!important;overflow-x:auto!important;background:#f6faf6!important;scrollbar-width:thin;max-width:100%!important;box-sizing:border-box!important}
html body #r2g-ai-floating .r2g-ai-topics button{flex:0 0 auto!important;display:inline-block!important;border:1px solid #c6dec9!important;background:#fff!important;color:#174a2b!important;border-radius:18px!important;font-size:11px!important;line-height:1.3!important;padding:6px 9px!important;margin:0!important;width:auto!important;height:auto!important;cursor:pointer!important}
html body #r2g-ai-floating .r2g-ai-topics button:focus-visible{outline:2px solid #174a2b!important}
