.rb176-research-chat-launcher{position:fixed;right:max(18px,env(safe-area-inset-right));bottom:max(82px,calc(env(safe-area-inset-bottom) + 18px));z-index:2147481800;display:flex;align-items:center;gap:8px;min-height:46px;padding:0 15px;color:#fff;border:0;border-radius:15px;background:linear-gradient(145deg,#1769d4,#124ba6);box-shadow:0 14px 34px rgba(8,46,94,.3);cursor:pointer;font:800 12px/1 Inter,"Noto Sans SC",sans-serif}
.rb176-research-chat-launcher svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.rb176-research-chat-launcher b{position:absolute;top:-7px;right:-7px;display:grid;place-items:center;min-width:20px;height:20px;padding:0 5px;color:#fff;border:2px solid #fff;border-radius:99px;background:#e43d3d;font-size:9px}
.rb176-research-chat-shell{position:fixed;inset:0;z-index:2147483200;padding:clamp(12px,3vw,34px);background:rgba(6,24,48,.54);backdrop-filter:blur(8px);font-family:Inter,"Noto Sans SC","Segoe UI",sans-serif}
.rb176-research-chat-shell[hidden]{display:none!important}
.rb176-research-chat-panel{display:grid;grid-template-columns:330px minmax(0,1fr);width:min(1120px,100%);height:min(760px,calc(100dvh - clamp(24px,6vw,68px)));margin:auto;overflow:hidden;border:1px solid rgba(255,255,255,.7);border-radius:22px;background:#fff;box-shadow:0 30px 90px rgba(4,20,40,.32)}
.rb176-chat-sidebar{display:grid;grid-template-rows:auto auto minmax(0,1fr);min-width:0;border-right:1px solid #dbe4ee;background:#f5f8fc}
.rb176-chat-sidebar>header{display:flex;align-items:center;justify-content:space-between;gap:10px;min-height:74px;padding:12px 14px;border-bottom:1px solid #dbe4ee;background:#fff}
.rb176-chat-sidebar>header span{min-width:0}.rb176-chat-sidebar>header strong,.rb176-chat-sidebar>header small{display:block}.rb176-chat-sidebar>header strong{color:#14375b;font-size:16px}.rb176-chat-sidebar>header small{margin-top:4px;color:#718499;font:9px/1.2 ui-monospace,SFMono-Regular,Menlo,monospace}
.rb176-chat-close{display:grid;place-items:center;width:40px;height:40px;flex:0 0 40px;padding:0;border:1px solid #cad6e3;border-radius:11px;background:#fff;cursor:pointer}
.rb176-chat-close i{position:relative;width:16px;height:16px}.rb176-chat-close i:before,.rb176-chat-close i:after{content:"";position:absolute;top:7px;left:1px;width:14px;height:2px;border-radius:2px;background:#48627e;transform:rotate(45deg)}.rb176-chat-close i:after{transform:rotate(-45deg)}
.rb176-chat-search{padding:12px;border-bottom:1px solid #dbe4ee;background:#fff}
.rb176-chat-search form{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:7px}.rb176-chat-search label{display:flex;align-items:center;gap:7px;min-width:0;height:40px;padding:0 10px;border:1px solid #c6d4e2;border-radius:10px;background:#f9fbfd}.rb176-chat-search label:focus-within{border-color:#5f96da;box-shadow:0 0 0 3px rgba(31,111,211,.1)}
.rb176-chat-search svg{width:17px;height:17px;flex:0 0 17px;fill:none;stroke:#698096;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}.rb176-chat-search input{width:100%;min-width:0;border:0;outline:0;background:transparent;font:11px/1 ui-monospace,SFMono-Regular,Menlo,monospace;text-transform:uppercase}.rb176-chat-search form>button,.rb176-chat-search-result button{min-height:40px;padding:0 12px;color:#fff;border:0;border-radius:10px;background:#1769d4;cursor:pointer;font-weight:800}.rb176-chat-search>small{display:block;margin-top:6px;color:#7c8c9d;font-size:9px}.rb176-chat-search-message{margin:7px 0 0;color:#9a5610;font-size:10px;line-height:1.45}
.rb176-chat-search-result{display:grid;grid-template-columns:34px minmax(0,1fr) auto;align-items:center;gap:8px;margin-top:9px;padding:8px;border:1px solid #d3e0ed;border-radius:11px;background:#f8fbff}.rb176-chat-search-result span:nth-child(2){min-width:0}.rb176-chat-search-result strong,.rb176-chat-search-result small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.rb176-chat-search-result strong{color:#254665;font-size:11px}.rb176-chat-search-result small{margin-top:2px;color:#6f8296;font:8px/1.2 ui-monospace,SFMono-Regular,Menlo,monospace}.rb176-chat-search-result em{max-width:92px;color:#50708e;font-size:9px;font-style:normal;text-align:right}
.rb176-chat-list{min-height:0;overflow:auto;padding:8px}.rb176-chat-list-item{position:relative;display:grid;grid-template-columns:42px minmax(0,1fr) auto;align-items:center;gap:10px;width:100%;min-height:62px;padding:8px 9px;color:inherit;border:0;border-radius:12px;background:transparent;text-align:left;cursor:pointer}.rb176-chat-list-item:hover,.rb176-chat-list-item.active{background:#e5eef9}.rb176-chat-list-item time{align-self:start;margin-top:6px;color:#8796a5;font-size:8px}.rb176-chat-list-copy{min-width:0}.rb176-chat-list-copy strong,.rb176-chat-list-copy small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.rb176-chat-list-copy strong{color:#1e405f;font-size:12px}.rb176-chat-list-copy small{margin-top:5px;color:#718397;font-size:9px}.rb176-chat-unread{display:grid;place-items:center;min-width:20px;height:20px;padding:0 5px;color:#fff;border-radius:99px;background:#e44141;font-size:9px}.rb176-chat-empty-list{margin:15px;padding:12px;color:#788b9e;border:1px dashed #c8d5e3;border-radius:10px;font-size:10px;line-height:1.6;text-align:center}
.rb176-chat-avatar{display:grid;place-items:center;width:42px;height:42px;flex:0 0 42px;color:#fff;border-radius:13px;background:linear-gradient(145deg,#458ee8,#2661ae);font-size:14px;font-weight:900}.rb176-chat-avatar.system{color:#2261a9;background:#dcecff}.rb176-chat-avatar svg{width:21px;height:21px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.rb176-chat-conversation{display:grid;grid-template-rows:auto minmax(0,1fr);min-width:0;min-height:0;background:#edf3f9}.rb176-chat-conversation:has(.rb176-chat-compose){grid-template-rows:auto minmax(0,1fr) auto}.rb176-chat-conversation-head{display:flex;align-items:center;gap:11px;min-height:74px;padding:11px 18px;border-bottom:1px solid #d5e0eb;background:#fff}.rb176-chat-conversation-head>span:last-child{min-width:0}.rb176-chat-conversation-head strong,.rb176-chat-conversation-head small{display:block}.rb176-chat-conversation-head strong{color:#183b5f;font-size:14px}.rb176-chat-conversation-head small{margin-top:4px;color:#74889b;font:9px/1.2 ui-monospace,SFMono-Regular,Menlo,monospace}.rb176-chat-mobile-back{display:none;width:40px;height:40px;padding:0;border:1px solid #cad6e2;border-radius:11px;background:#fff}.rb176-chat-mobile-back svg{width:20px;height:20px;fill:none;stroke:#375873;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.rb179-no-chat-motion .rb176-chat-conversation{transition:none!important;animation:none!important}
.rb176-chat-message-stream,.rb176-chat-system-stream{min-height:0;overflow:auto;padding:20px}.rb176-chat-message-stream{display:flex;flex-direction:column;gap:8px}.rb176-chat-bubble{max-width:min(72%,620px)}.rb176-chat-bubble div{padding:10px 13px;border-radius:15px;color:#26445f;background:#fff;box-shadow:0 3px 10px rgba(24,57,91,.06);font-size:13px;line-height:1.55;overflow-wrap:anywhere}.rb176-chat-bubble small{display:block;margin-top:4px;color:#7b8c9d;font-size:8px}.rb176-chat-bubble.mine{align-self:flex-end}.rb176-chat-bubble.mine div{color:#fff;border-bottom-right-radius:5px;background:#1e6ed2}.rb176-chat-bubble.mine small{text-align:right}.rb176-chat-bubble.theirs{align-self:flex-start}.rb176-chat-bubble.theirs div{border-bottom-left-radius:5px}
.rb176-chat-compose{display:grid;grid-template-columns:minmax(0,1fr) 46px;align-items:end;gap:9px;padding:12px 16px max(12px,env(safe-area-inset-bottom));border-top:1px solid #d5e0eb;background:#fff}.rb176-chat-compose textarea{width:100%;min-height:46px;max-height:130px;padding:12px 13px;border:1px solid #c5d4e2;border-radius:13px;outline:0;resize:vertical;font:13px/1.45 inherit}.rb176-chat-compose textarea:focus{border-color:#5e96d9;box-shadow:0 0 0 3px rgba(31,111,211,.1)}.rb176-chat-compose button{display:grid;place-items:center;width:46px;height:46px;padding:0;color:#fff;border:0;border-radius:13px;background:#1769d4;cursor:pointer}.rb176-chat-compose button:disabled{opacity:.5}.rb176-chat-compose svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.rb176-chat-system-stream{display:grid;align-content:start;gap:10px}.rb176-chat-system-card{display:grid;grid-template-columns:42px minmax(0,1fr);gap:11px;padding:13px;border:1px solid #d7e2ed;border-radius:14px;background:#fff}.rb176-chat-system-card.unread{border-color:#88b5e9;box-shadow:inset 3px 0 #2774cf}.rb176-chat-system-card strong,.rb176-chat-system-card small{display:block}.rb176-chat-system-card strong{color:#284762;font-size:12px;line-height:1.5}.rb176-chat-system-card small{margin-top:5px;color:#7b8b9b;font-size:9px}.rb176-chat-request-actions{display:flex;gap:8px;margin-top:10px}.rb176-chat-request-actions button{min-height:36px;padding:0 13px;color:#465f77;border:1px solid #c8d5e1;border-radius:9px;background:#fff;cursor:pointer;font-weight:800}.rb176-chat-request-actions button.accept{color:#fff;border-color:#1769d4;background:#1769d4}.rb176-chat-empty{margin:auto;padding:24px;color:#738699;font-size:12px;text-align:center}
html.rb176-research-chat-open{overflow:hidden}
@media(max-width:700px){
  .rb176-research-chat-launcher{right:max(10px,env(safe-area-inset-right));bottom:max(72px,calc(env(safe-area-inset-bottom) + 12px));width:48px;height:48px;min-height:48px;padding:0;justify-content:center;border-radius:15px}.rb176-research-chat-launcher>span{display:none}
  .rb176-research-chat-shell{padding:0;background:#eef3f8;backdrop-filter:none}
  .rb176-research-chat-panel{display:block;width:100%;height:100dvh;border:0;border-radius:0;box-shadow:none}
  .rb176-chat-sidebar{width:100%;height:100dvh;border-right:0}.rb176-chat-sidebar>header{padding-top:max(12px,env(safe-area-inset-top));min-height:calc(68px + env(safe-area-inset-top))}
  .rb176-chat-conversation{position:absolute;inset:0;display:grid;height:100dvh;transform:translateX(100%);transition:transform .18s ease}.rb176-chat-conversation.selected{transform:translateX(0)}
  .rb176-chat-mobile-back{display:grid;place-items:center;flex:0 0 40px}
  .rb176-chat-conversation-head{padding-top:max(11px,env(safe-area-inset-top));min-height:calc(68px + env(safe-area-inset-top))}
  .rb176-chat-message-stream,.rb176-chat-system-stream{padding:14px 11px}.rb176-chat-bubble{max-width:84%}
  .rb176-chat-search input{font-size:16px}.rb176-chat-compose textarea{font-size:16px}
}
@media(min-width:701px){html.rb-layout-mobile .rb176-research-chat-shell{padding:0}html.rb-layout-mobile .rb176-research-chat-panel{width:100%;height:100dvh;border:0;border-radius:0}}

/* The device runtime supplies visual-viewport dimensions while the iOS
   keyboard is visible. These fallbacks also protect this stylesheet when it
   loads after the shared device overrides. */
html.rb-layout-mobile.rb-ios.rb-virtual-keyboard-open .rb176-research-chat-shell{position:fixed!important;inset:auto!important;top:var(--rb179-visual-viewport-top,0px)!important;left:var(--rb179-visual-viewport-left,0px)!important;width:var(--rb179-visual-viewport-width,100vw)!important;height:var(--rb179-visual-viewport-height,100dvh)!important;overflow:hidden!important}
html.rb-layout-mobile.rb-ios.rb-virtual-keyboard-open .rb176-research-chat-panel,html.rb-layout-mobile.rb-ios.rb-virtual-keyboard-open .rb176-chat-sidebar,html.rb-layout-mobile.rb-ios.rb-virtual-keyboard-open .rb176-chat-conversation{height:100%!important;min-height:0!important;max-height:100%!important}
html.rb-layout-mobile.rb-ios.rb-virtual-keyboard-open .rb176-chat-message-stream,html.rb-layout-mobile.rb-ios.rb-virtual-keyboard-open .rb176-chat-system-stream{min-height:0!important;overflow-y:auto!important;-webkit-overflow-scrolling:touch!important}
html.rb-layout-mobile.rb-ios.rb-virtual-keyboard-open .rb176-chat-compose{position:relative!important;inset:auto!important;padding-bottom:9px!important}

/* ResearchBook 1.84: standalone iOS already anchors fixed chat shells to the
   visible viewport. Do not add visualViewport.offsetTop a second time. */
html.rb-pwa-standalone.rb-layout-mobile.rb-ios.rb-virtual-keyboard-open .rb176-research-chat-shell{
  top:0!important;
  left:0!important;
  margin:0!important;
}

/* ResearchBook 1.84: keep the mobile researcher chat shell opaque and full
   height during iOS keyboard animation. Only the composer receives the bounded
   keyboard inset; visualViewport.height never becomes the shell height. */
html.rb-layout-mobile.rb-ios.rb181-chat-viewport-locked .rb176-research-chat-shell{
  position:fixed!important;inset:0!important;top:0!important;left:0!important;right:0!important;bottom:auto!important;
  width:100vw!important;height:var(--rb181-chat-layout-height,100dvh)!important;
  min-height:var(--rb181-chat-layout-height,100dvh)!important;max-height:var(--rb181-chat-layout-height,100dvh)!important;
  margin:0!important;overflow:hidden!important;transform:none!important;background:#eef3f8!important;backdrop-filter:none!important;
}
html.rb-layout-mobile.rb-ios.rb181-chat-viewport-locked .rb176-research-chat-panel,
html.rb-layout-mobile.rb-ios.rb181-chat-viewport-locked .rb176-chat-sidebar,
html.rb-layout-mobile.rb-ios.rb181-chat-viewport-locked .rb176-chat-conversation{
  height:100%!important;min-height:0!important;max-height:100%!important;
}
html.rb-layout-mobile.rb-ios.rb181-chat-viewport-locked.rb-virtual-keyboard-open .rb176-chat-compose{
  position:relative!important;inset:auto!important;bottom:auto!important;
  padding-bottom:calc(9px + env(safe-area-inset-bottom) + var(--rb181-keyboard-inset,0px))!important;
}
html.rb-layout-mobile.rb-ios.rb181-chat-viewport-locked .rb176-chat-message-stream,
html.rb-layout-mobile.rb-ios.rb181-chat-viewport-locked .rb176-chat-system-stream{
  min-height:0!important;overflow-y:auto!important;overscroll-behavior:contain!important;-webkit-overflow-scrolling:touch!important;
}

/* ResearchBook 1.84: keep the mobile researcher shell opaque/full-size while
   the actual conversation surface follows the settled visible viewport. This
   removes the 1.84 keyboard-sized composer padding / scrollable blank block. */
html.rb-layout-mobile.rb-ios.rb182-chat-viewport-locked .rb176-research-chat-shell{
  position:fixed!important;inset:0!important;width:100vw!important;
  height:var(--rb182-chat-layout-height,100dvh)!important;
  min-height:var(--rb182-chat-layout-height,100dvh)!important;max-height:var(--rb182-chat-layout-height,100dvh)!important;
  padding:0!important;overflow:hidden!important;overscroll-behavior:none!important;background:#eef3f8!important;backdrop-filter:none!important;
}
html.rb-layout-mobile.rb-ios.rb182-chat-viewport-locked .rb176-research-chat-panel{
  width:100%!important;height:var(--rb182-chat-visible-height,var(--rb182-chat-layout-height,100dvh))!important;
  min-height:0!important;max-height:var(--rb182-chat-visible-height,var(--rb182-chat-layout-height,100dvh))!important;
  margin:0!important;overflow:hidden!important;border:0!important;border-radius:0!important;box-shadow:none!important;
}
html.rb-layout-mobile.rb-ios.rb182-chat-viewport-locked .rb176-chat-sidebar,
html.rb-layout-mobile.rb-ios.rb182-chat-viewport-locked .rb176-chat-conversation{
  height:100%!important;min-height:0!important;max-height:100%!important;overflow:hidden!important;
}
html.rb-layout-mobile.rb-ios.rb182-chat-viewport-locked .rb176-chat-message-stream,
html.rb-layout-mobile.rb-ios.rb182-chat-viewport-locked .rb176-chat-system-stream,
html.rb-layout-mobile.rb-ios.rb182-chat-viewport-locked .rb176-chat-list{
  min-height:0!important;overflow-y:auto!important;overflow-x:hidden!important;overscroll-behavior:contain!important;-webkit-overflow-scrolling:touch!important;
}
html.rb-layout-mobile.rb-ios.rb182-chat-viewport-locked.rb-virtual-keyboard-open .rb176-chat-compose{
  position:relative!important;inset:auto!important;bottom:auto!important;margin:0!important;
  padding:9px 16px!important;transform:none!important;
}

/* Beta 2.1 R2 — private administrator-granted AI research assistant. */
.rb176-chat-avatar.ai{color:#fff;background:linear-gradient(145deg,#7357dc,#3f36a8);font-size:11px;letter-spacing:.02em}
.rb200-ai-badge{display:inline-flex;align-items:center;min-height:18px;margin-left:7px;padding:0 6px;color:#4936a7;border:1px solid #c9bdf3;border-radius:999px;background:#f0edff;font:800 8px/1 Inter,"Noto Sans SC",sans-serif;vertical-align:middle}
.rb200-ai-friend{background:linear-gradient(90deg,rgba(239,235,255,.7),transparent)}
.rb200-ai-notice{display:flex;align-items:flex-start;gap:9px;padding:9px 16px;color:#4a4370;border-bottom:1px solid #ddd5f5;background:#f7f5ff;font-size:10px;line-height:1.5}
.rb200-ai-notice strong{flex:0 0 auto;color:#4938a4}.rb200-ai-notice.unavailable{color:#7b4d16;border-color:#efd19e;background:#fff8e8}.rb200-ai-notice.unavailable strong{color:#8a5311}
.rb176-chat-conversation:has(.rb200-ai-notice){grid-template-rows:auto auto minmax(0,1fr) auto}
.rb176-chat-bubble.ai>div{border:1px solid #e0daf7;background:#fdfcff}
.rb200-ai-sources{display:grid;gap:4px;margin-top:5px;padding:8px 10px;border:1px solid #ddd7f4;border-radius:11px;background:#f8f6ff}
.rb200-ai-sources b{color:#504291;font-size:9px}.rb200-ai-sources a{display:block;color:#315fa9;font-size:10px;line-height:1.35;text-decoration:none;overflow-wrap:anywhere}.rb200-ai-sources a:hover{text-decoration:underline}
.rb200-ai-compose[aria-busy="true"]:before{content:"AI…";align-self:center;color:#6556aa;font-size:10px;font-weight:800}
.rb200-ai-compose[aria-busy="true"]{grid-template-columns:auto minmax(0,1fr) 46px}
@media(max-width:700px){
  .rb200-ai-notice{padding:8px 11px;font-size:9px}
  .rb176-chat-bubble.ai{max-width:92%}
  .rb200-ai-compose[aria-busy="true"]{grid-template-columns:minmax(0,1fr) 46px}
  .rb200-ai-compose[aria-busy="true"]:before{display:none}
}

/* ResearchBook 1.99: administrator card/profile review results in System messages. */
.rb197-profile-notice{border-left:4px solid #24745e}
.rb197-profile-notice.rejected{border-color:#d05246}
.rb197-profile-notice>div>p{margin:6px 0 0;color:#556d83;font-size:10px;line-height:1.55}
.rb197-profile-reason{display:grid;gap:2px;padding:8px;border-radius:8px;color:#7f3029!important;background:#fff0ee}
.rb197-profile-marks{display:grid;gap:6px;margin-top:8px}
.rb197-profile-marks span{display:grid;gap:2px;padding:8px 9px;border-left:3px solid #d05246;border-radius:4px;color:#8e2d25;background:#fff1ef;font-size:9px;line-height:1.45}
.rb197-profile-marks b{font-size:9px}
.rb197-profile-notice-action{min-height:36px;margin-top:10px;padding:0 12px;border:1px solid #6ea1d4;border-radius:9px;color:#185d9e;background:#f3f8fe;cursor:pointer;font-size:9px;font-weight:820}
.rb197-profile-notice.rejected .rb197-profile-notice-action{color:#9a2d24;border-color:#dc9992;background:#fff5f3}
