/* ResearchBook 1.84: device-class layouts are selected by device-layout-179.js before sign-in UI mounts. */
html.rb-layout-mobile.rb-ios{
  --rb179-ios-top-clearance:max(58px,calc(env(safe-area-inset-top) + 14px));
}

/* Safari's translucent top sheet must never sit on top of a tappable logo,
   account control or full-screen chat header. The fixed minimum also covers
   Safari tabs where safe-area-inset-top is reported as zero. */
html.rb-layout-mobile.rb-ios .class-sidebar:not(.class-admin-sidebar){padding-top:var(--rb179-ios-top-clearance)!important}
html.rb-layout-mobile.rb-ios .class-sidebar:not(.class-admin-sidebar)~.class-main{padding-top:var(--rb179-ios-top-clearance)!important}
html.rb-layout-mobile.rb-ios .class-admin-sidebar{padding-top:var(--rb179-ios-top-clearance)!important}
html.rb-layout-mobile.rb-ios .rb-account-button{top:var(--rb179-ios-top-clearance)!important}
html.rb-layout-mobile.rb-ios .class-account-menu{top:calc(var(--rb179-ios-top-clearance) + 54px)!important}
html.rb-layout-mobile.rb-ios .workspace{padding-top:var(--rb179-ios-top-clearance)!important}
html.rb-layout-mobile.rb-ios .portfolio-bar{margin-top:0!important}
html.rb-layout-mobile.rb-ios .rb-auth-shell,
html.rb-layout-mobile.rb-ios .class-auth,
html.rb-layout-mobile.rb-ios .rb-role-chooser,
html.rb-layout-mobile.rb-ios .rb-public-entry{padding-top:var(--rb179-ios-top-clearance)!important}
html.rb-layout-mobile.rb-ios .class-chat-card.immersive .class-chat-page-head,
html.rb-layout-mobile.rb-ios .rb176-chat-sidebar>header,
html.rb-layout-mobile.rb-ios .rb176-chat-conversation-head{padding-top:var(--rb179-ios-top-clearance)!important}
html.rb-layout-mobile.rb-ios .class-chat-card.immersive .class-chat-header{padding-top:8px!important}

/* iOS may pan the layout viewport by hundreds of pixels when a textarea gets
   focus. Keep full-screen chats attached to the visual viewport instead of
   feeding that transient offset back into header padding. */
html.rb-layout-mobile.rb-ios.rb-virtual-keyboard-open .class-chat-overlay,
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;
  max-width:none!important;
  max-height:none!important;
  overflow:hidden!important;
}
html.rb-layout-mobile.rb-ios.rb-virtual-keyboard-open .class-chat-overlay-content,
html.rb-layout-mobile.rb-ios.rb-virtual-keyboard-open .class-chat-card.immersive,
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 .class-chat-card.immersive .class-chat-page-head{
  padding-top:max(9px,env(safe-area-inset-top))!important;
}
html.rb-layout-mobile.rb-ios.rb-virtual-keyboard-open .class-chat-card.immersive .class-chat-layout{
  height:auto!important;
  min-height:0!important;
}
html.rb-layout-mobile.rb-ios.rb-virtual-keyboard-open .class-chat-card.immersive .class-chat-main{
  height:100%!important;
  min-height:0!important;
  overflow:hidden!important;
}
html.rb-layout-mobile.rb-ios.rb-virtual-keyboard-open .class-chat-card.immersive .class-chat-header{
  min-height:58px!important;
  padding:7px 10px!important;
}
html.rb-layout-mobile.rb-ios.rb-virtual-keyboard-open .class-chat-card.immersive .class-chat-stream,
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 .class-chat-card.immersive .class-chat-composer,
html.rb-layout-mobile.rb-ios.rb-virtual-keyboard-open .rb176-chat-compose{
  position:relative!important;
  inset:auto!important;
  padding-bottom:9px!important;
}
html.rb-layout-desktop .rb-account-button{
  display:flex!important;visibility:visible!important;opacity:1!important;pointer-events:auto!important;
  top:max(12px,env(safe-area-inset-top))!important;right:12px!important;width:auto!important;min-width:40px!important;
  z-index:2147483100!important;
}
html.rb-layout-desktop .rb-account-button .rb-account-copy{display:block!important}
html.rb-layout-mobile .rb-account-button{
  display:grid!important;visibility:visible!important;opacity:1!important;pointer-events:auto!important;
  place-items:center!important;top:max(9px,env(safe-area-inset-top))!important;right:max(9px,env(safe-area-inset-right))!important;
  width:46px!important;height:46px!important;min-height:46px!important;padding:5px!important;border-radius:13px!important;
}
html.rb-layout-mobile .rb-account-button .rb-account-copy{display:none!important}
html.rb-layout-mobile .rb-account-button .rb-account-avatar{width:34px!important;height:34px!important}
html.rb-layout-mobile,html.rb-layout-mobile body{max-width:100%!important;overflow-x:hidden!important}
html.rb-layout-mobile body{overscroll-behavior-x:none!important}

/* Sign-in and role selection use the detected mobile layout as well as the
   width breakpoint, so iPhone standalone mode and narrow desktop-class user
   agents receive the same touch-safe screen. */
html.rb-layout-mobile .rb-auth-shell{
  align-items:start!important;min-height:100dvh!important;
  padding:max(10px,env(safe-area-inset-top)) max(10px,env(safe-area-inset-right)) max(10px,env(safe-area-inset-bottom)) max(10px,env(safe-area-inset-left))!important;
}
html.rb-layout-mobile .rb-auth-card{width:100%!important;max-width:480px!important;margin:auto!important;padding:18px 16px!important;border-radius:16px!important}
html.rb-layout-mobile .rb-auth-card-minimal{max-width:430px!important}
html.rb-layout-mobile .rb-auth-brand-row{align-items:center!important;gap:8px!important;margin-bottom:18px!important}
html.rb-layout-mobile .rb-auth-language{min-width:0!important;max-width:42%!important}
html.rb-layout-mobile .rb-auth-language select{width:100%!important;max-width:100%!important;min-height:42px!important;font-size:10px!important}
html.rb-layout-mobile .rb-auth-card h1{font-size:24px!important}
html.rb-layout-mobile .rb-field input{height:50px!important;font-size:16px!important}
html.rb-layout-mobile .rb-auth-card .rb-primary{min-height:50px!important}
html.rb-layout-mobile .rb-role-chooser{width:min(100% - 16px,880px)!important;padding:max(8px,env(safe-area-inset-top)) 0 max(16px,env(safe-area-inset-bottom))!important}
html.rb-layout-mobile .rb-role-chooser-head{padding:16px!important;border-radius:17px!important}
html.rb-layout-mobile .rb-role-chooser-head .rb-portal-copy{margin-top:22px!important}
html.rb-layout-mobile .rb-role-chooser-head .rb-portal-copy h1{font-size:30px!important;margin-bottom:0!important}
html.rb-layout-mobile .rb-role-chooser .rb-role-choice-grid{grid-template-columns:1fr!important;gap:9px!important;margin-top:10px!important}
html.rb-layout-mobile .rb-role-chooser .rb-role-choice-card{grid-template-columns:42px minmax(0,1fr) 22px!important;min-height:66px!important;padding:11px 13px!important;border-radius:14px!important}
html.rb-layout-mobile .rb-role-chooser .rb-role-choice-card h2{margin:0!important;font-size:15px!important}
html.rb-layout-mobile .rb-public-entry{
  width:min(100% - 20px,680px)!important;min-height:100dvh!important;margin:auto!important;
  padding:max(10px,env(safe-area-inset-top)) 0 max(10px,env(safe-area-inset-bottom))!important;
}
html.rb-layout-mobile .rb-public-entry-card{width:100%!important;padding:20px 17px!important;border-radius:17px!important}
html.rb-layout-mobile .rb-public-entry-card .rb-portal-copy{margin-top:26px!important}
html.rb-layout-mobile .rb-public-entry-card .rb-portal-copy h1{margin:0!important;font-size:30px!important}
html.rb-layout-mobile .rb-public-entry-card .rb-portal-actions{display:grid!important;grid-template-columns:1fr!important;gap:9px!important;margin-top:22px!important}
html.rb-layout-mobile .rb-public-entry-card .rb-portal-actions a{width:100%!important;min-height:52px!important}
html.rb-layout-mobile .class-auth{min-height:100dvh!important;padding:max(10px,env(safe-area-inset-top)) max(10px,env(safe-area-inset-right)) max(10px,env(safe-area-inset-bottom)) max(10px,env(safe-area-inset-left))!important}
html.rb-layout-mobile .class-auth-card{width:100%!important;max-width:430px!important;margin:auto!important;padding:18px 16px!important;border-radius:16px!important}
html.rb-layout-mobile .class-auth-card .class-brand-wrap{align-items:center!important;gap:8px!important;margin-bottom:18px!important}
html.rb-layout-mobile .class-auth-card .class-language-select{min-width:0!important;max-width:42%!important}
html.rb-layout-mobile .class-auth-card .class-language-select select{width:100%!important;max-width:100%!important;min-height:42px!important;font-size:10px!important}
html.rb-layout-mobile .class-auth-card .class-field input{min-height:50px!important;font-size:16px!important}
html.rb-layout-mobile .class-auth-card .class-primary{min-height:50px!important}

/* Desktop keeps the original top-right account control and a horizontal top bar. */
html.rb-layout-desktop .class-topbar{align-items:center!important}
html.rb-layout-desktop .class-topbar-actions{width:auto!important;align-items:center!important;flex-direction:row!important}
html.rb-layout-desktop .class-topbar-actions>.class-language-select{width:auto!important}
html.rb-layout-desktop .class-account-wrap{width:auto!important}
html.rb-layout-desktop .class-account-button{width:auto!important;min-width:0!important;pointer-events:auto!important}
html.rb-layout-desktop .class-account-button>span:nth-child(2){display:grid!important}

/* Mobile gets a compact app header: language remains available and Account stays at the top-right. */
html.rb-layout-mobile .class-topbar{
  display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;align-items:start!important;gap:10px!important;
}
html.rb-layout-mobile .class-topbar>div:first-child{grid-column:1;min-width:0}
html.rb-layout-mobile .class-topbar-actions{
  grid-column:2;width:auto!important;align-items:center!important;align-self:start!important;flex-direction:row!important;gap:7px!important;
}
html.rb-layout-mobile .class-inbox-alert{width:46px;height:46px;min-height:46px;flex:0 0 46px;padding:0;border-radius:13px}
html.rb-layout-mobile .class-inbox-alert-label{display:none}
html.rb-layout-mobile .class-topbar-actions>.class-language-select{display:none!important}
html.rb-layout-mobile .class-topbar-actions>.class-language-select select{
  width:100%!important;max-width:112px!important;min-height:46px!important;padding-inline:8px!important;font-size:12px!important;
}
html.rb-layout-mobile .class-nav [data-nav="inbox"]{position:relative}
html.rb-layout-mobile .class-nav [data-nav="inbox"]>.class-inbox-badge{position:absolute;top:-5px;right:-5px;min-width:18px;height:18px;padding:0 5px;font-size:9px;box-shadow:0 0 0 3px var(--class-sidebar-a)}
html.rb-layout-mobile .class-account-wrap{width:46px!important;flex:0 0 46px!important}
html.rb-layout-mobile .class-account-button{
  display:grid!important;grid-template-columns:1fr!important;place-items:center!important;width:46px!important;height:46px!important;
  min-height:46px!important;padding:5px!important;pointer-events:auto!important;
}
html.rb-layout-mobile .class-account-button>span:nth-child(2),
html.rb-layout-mobile .class-account-button>.class-icon{display:none!important}
html.rb-layout-mobile .class-account-menu{
  position:fixed!important;top:calc(env(safe-area-inset-top) + 62px)!important;right:10px!important;
  z-index:2147482500!important;width:min(330px,calc(100vw - 20px))!important;max-width:calc(100vw - 20px)!important;
}

/* iOS renders sticky translucent bars as a blurred sheet over controls while
   the page scrolls.  Mobile uses a normal compact bar with an opaque surface. */
html.rb-layout-mobile .portfolio-bar{
  position:static!important;top:auto!important;z-index:auto!important;display:grid!important;
  grid-template-columns:minmax(0,1fr) 48px!important;gap:8px!important;min-height:0!important;
  margin:-20px 0 14px!important;padding:10px!important;border-radius:0 0 12px 12px!important;
  background:#fff!important;-webkit-backdrop-filter:none!important;backdrop-filter:none!important;
}
html.rb-layout-mobile .portfolio-bar .portfolio-home{display:none!important}
html.rb-layout-mobile .portfolio-bar .experiment-switcher{grid-column:1;grid-template-columns:1fr!important;gap:4px!important}
html.rb-layout-mobile .portfolio-bar .experiment-switcher>span{display:none!important}
html.rb-layout-mobile .portfolio-bar .experiment-switcher select{height:48px!important;font-size:16px!important}
html.rb-layout-mobile .portfolio-bar .manage-experiments{grid-column:2;width:48px!important;height:48px!important;padding:0!important;justify-content:center!important;font-size:0!important}
html.rb-layout-mobile .workspace{width:100%!important;max-width:100%!important;padding-inline:12px!important;overflow:visible!important}
html.rb-layout-mobile .topbar,html.rb-layout-mobile .dashboard-grid,html.rb-layout-mobile .primary-column,html.rb-layout-mobile .detail-column{min-width:0!important;max-width:100%!important}
html.rb-layout-mobile .beta-corner{display:none!important}
html.rb-layout-mobile .participant-selection-bar{-webkit-backdrop-filter:none!important;backdrop-filter:none!important;background:#fff!important}

/* Research dashboard controls get fixed grid areas instead of wrapping into
   the tall, sparse desktop toolbar shown in the mobile screenshot. */
html.rb-layout-mobile #rb15-dashboard>.rb15-dashboard-head{
  display:grid!important;grid-template-columns:minmax(0,1fr) 48px!important;
  align-items:center!important;gap:9px!important;padding:12px!important;border:1px solid #d4e0eb!important;
  border-radius:14px!important;background:#fff!important;
}
html.rb-layout-mobile #rb15-dashboard .rb15-dashboard-title{grid-column:1;grid-row:1;justify-self:start!important;text-align:left!important}
html.rb-layout-mobile #rb15-dashboard .rb15-dashboard-title>span{display:none!important}
html.rb-layout-mobile #rb15-dashboard .rb15-dashboard-title strong{font-size:18px!important}
html.rb-layout-mobile #rb15-dashboard .rb175-dashboard-toggle{grid-column:2!important;grid-row:1!important;margin:0!important}
html.rb-layout-mobile #rb15-dashboard .rb15-scope{grid-column:1/-1!important;grid-row:3!important;width:100%!important;justify-content:stretch!important}
html.rb-layout-mobile #rb15-dashboard .rb15-scope>span{flex:0 0 auto!important}
html.rb-layout-mobile #rb15-dashboard .rb15-scope select{min-width:0!important;max-width:none!important;width:100%!important;height:48px!important;font-size:16px!important}
html.rb-layout-mobile #rb15-dashboard .rb15-enhance-toolbar{grid-column:1!important;grid-row:2!important;justify-self:start!important;margin:0!important}
html.rb-layout-mobile #rb15-dashboard #rb15-mode-switch{grid-column:1/-1!important;grid-row:4!important;display:grid!important;grid-template-columns:1fr 1fr!important;width:100%!important;margin:0!important;gap:7px!important}
html.rb-layout-mobile #rb15-dashboard #rb15-mode-switch button{width:100%!important;min-height:48px!important}
html.rb-layout-mobile #rb15-dashboard .rb15-grid{grid-template-columns:1fr!important}
html.rb-layout-mobile #rb15-dashboard .rb15-card,html.rb-layout-mobile #rb15-dashboard .rb15-enhance-card{grid-column:1/-1!important;min-width:0!important}

/* Modal surfaces stay inside the visual viewport on every role page. */
html.rb-layout-mobile .class-modal-shell,html.rb-layout-mobile .rb15-enhance-modal,
html.rb-layout-mobile .rb157-calendar-shell,html.rb-layout-mobile .rb175-attention-overlay{
  width:100%!important;max-width:100vw!important;padding:0!important;-webkit-backdrop-filter:none!important;backdrop-filter:none!important;
}
html.rb-layout-mobile .class-modal,html.rb-layout-mobile .rb15-enhance-dialog,html.rb-layout-mobile .rb157-calendar-modal{
  width:100%!important;max-width:100%!important;max-height:100dvh!important;border-radius:0!important;
  padding-bottom:max(16px,env(safe-area-inset-bottom))!important;
}

/* The long-standing experiment-record control remains an independent control. */
html.rb-layout-desktop .dashboard-grid:not(.rb154-detail-panel-collapsed) .rb154-detail-panel-toggle{
  position:absolute!important;top:10px!important;left:-13px!important;right:auto!important;margin:0!important;
  width:30px!important;height:30px!important;min-width:30px!important;min-height:30px!important;pointer-events:auto!important;
}

/* Desktop uses the account/settings language selector only.  The research
   page no longer shows a second language control. */
html.rb-layout-desktop .workspace .topbar-actions .language-menu{display:none!important}

/* The fixed beta/privacy ribbon previously covered the sidebar Settings
   control.  The same notice remains available in Settings and the account
   disclaimer, so the redundant desktop overlay is removed. */
html.rb-layout-desktop .beta-corner{display:none!important}

html.rb-layout-desktop .rb-research-settings-shortcut{
  display:inline-flex!important;align-items:center;justify-content:center;gap:7px;
  min-height:42px;padding:0 14px;border:1px solid #b8cbe2;border-radius:10px;
  color:#245b99;background:#fff;cursor:pointer;font-size:12px;font-weight:800;
  box-shadow:0 4px 14px rgba(20,55,91,.08);
}
html.rb-layout-desktop .rb-research-settings-shortcut:hover{background:#edf5ff;border-color:#7da5d3}
html.rb-layout-mobile .rb-research-settings-shortcut{display:none!important}
html.rb-layout-mobile .dashboard-grid,
html.rb-layout-mobile .dashboard-grid.rb154-detail-panel-collapsed{grid-template-columns:1fr!important}
html.rb-layout-mobile .dashboard-grid.rb154-detail-panel-collapsed .detail-column{min-height:48px!important;order:-1}
html.rb-layout-mobile .dashboard-grid.rb154-detail-panel-collapsed .rb154-detail-panel-toggle{
  position:static!important;display:flex!important;width:100%!important;height:48px!important;min-height:48px!important;
  margin:0!important;flex-direction:row!important;pointer-events:auto!important;
}
html.rb-layout-mobile .dashboard-grid.rb154-detail-panel-collapsed .rb154-detail-panel-toggle b{
  display:block!important;writing-mode:horizontal-tb!important;
}
html.rb-layout-mobile .dashboard-grid:not(.rb154-detail-panel-collapsed) .rb154-detail-panel-toggle{
  position:absolute!important;top:8px!important;right:8px!important;left:auto!important;width:46px!important;height:46px!important;
  min-width:46px!important;min-height:46px!important;pointer-events:auto!important;
}

/* The administrator portal follows the detected device class instead of a
   width-only breakpoint. This also covers iPad desktop-class user agents. */
html.rb-layout-mobile .class-admin-sidebar{
  position:relative!important;inset:auto!important;width:100%!important;height:auto!important;min-height:0!important;
  display:block!important;overflow:visible!important;padding:max(10px,env(safe-area-inset-top)) 10px 10px!important;
  border-right:0!important;border-bottom:1px solid rgba(255,255,255,.12)!important;
}
html.rb-layout-mobile .class-admin-sidebar .class-brand{
  margin:0 0 9px!important;padding:0 4px!important;gap:9px!important;
}
html.rb-layout-mobile .class-admin-sidebar .class-brand-mark{width:36px!important;height:36px!important;border-radius:10px!important}
html.rb-layout-mobile .class-admin-sidebar .class-brand strong{font-size:13px!important}
html.rb-layout-mobile .class-admin-sidebar .class-brand small{font-size:9px!important}
html.rb-layout-mobile .class-admin-nav{display:block!important;overflow:visible!important}
html.rb-layout-mobile .class-admin-nav-scroll{
  display:flex!important;align-items:center!important;gap:6px!important;width:100%!important;overflow-x:auto!important;
  padding:1px 1px 8px!important;scrollbar-width:none!important;overscroll-behavior-inline:contain!important;
  -webkit-overflow-scrolling:touch!important;
}
html.rb-layout-mobile .class-admin-nav-scroll::-webkit-scrollbar{display:none!important}
html.rb-layout-mobile .class-admin-nav-scroll .class-nav-section{display:none!important}
html.rb-layout-mobile .class-admin-nav-scroll button{
  flex:0 0 auto!important;width:auto!important;min-width:max-content!important;min-height:44px!important;
  padding:0 12px!important;white-space:nowrap!important;
}
html.rb-layout-mobile .class-admin-nav-scroll button span{display:inline!important}
html.rb-layout-mobile .class-admin-sidebar .rb15-admin-sidebar-dashboard{
  width:100%!important;margin:0!important;padding:8px 0 0!important;overflow:hidden!important;
}
html.rb-layout-mobile .class-admin-sidebar .rb15-admin-side-head{padding:0 3px!important}
html.rb-layout-mobile .class-admin-sidebar .rb15-admin-side-list{
  display:flex!important;gap:7px!important;width:100%!important;overflow-x:auto!important;padding:0 1px 3px!important;
  scrollbar-width:none!important;-webkit-overflow-scrolling:touch!important;
}
html.rb-layout-mobile .class-admin-sidebar .rb15-admin-side-list::-webkit-scrollbar{display:none!important}
html.rb-layout-mobile .class-admin-sidebar .rb15-admin-side-item{
  flex:0 0 min(168px,72vw)!important;width:min(168px,72vw)!important;min-height:48px!important;
}
html.rb-layout-mobile .class-admin-sidebar .class-sidebar-footer{display:none!important}
html.rb-layout-mobile .class-admin-sidebar~.class-main{
  width:100%!important;max-width:none!important;margin-left:0!important;padding:12px 10px calc(22px + env(safe-area-inset-bottom))!important;
}
html.rb-layout-mobile .class-admin-topbar{
  display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;align-items:start!important;gap:9px!important;
  margin-bottom:10px!important;padding:0 0 10px!important;
}
html.rb-layout-mobile .class-admin-topbar .class-topbar-actions{grid-column:2!important}
html.rb-layout-mobile .class-admin-topbar h1{font-size:21px!important}
html.rb-layout-mobile .class-admin-page-head,
html.rb-layout-mobile .class-admin-role-head{
  display:grid!important;grid-template-columns:1fr!important;align-items:start!important;gap:10px!important;
}
html.rb-layout-mobile .class-admin-page-head .class-primary,
html.rb-layout-mobile .class-admin-role-head .class-primary{width:100%!important;min-height:46px!important}
html.rb-layout-mobile .class-admin-grid,
html.rb-layout-mobile .class-admin-grid-clean{grid-template-columns:minmax(0,1fr)!important}
html.rb-layout-mobile .class-admin-service-card{position:static!important}
html.rb-layout-mobile .class-account-row{grid-template-columns:minmax(0,1fr)!important;gap:10px!important}
html.rb-layout-mobile .class-account-role-editor,
html.rb-layout-mobile .class-account-actions{grid-column:auto!important;width:100%!important}
html.rb-layout-mobile .class-account-actions{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important}
html.rb-layout-mobile .class-account-actions button{min-height:46px!important;white-space:normal!important}
html.rb-layout-mobile .class-message-item{min-width:0!important;padding:12px!important;overflow-wrap:anywhere!important}
html.rb-layout-mobile .class-admin-mailbox-title{display:grid!important;grid-template-columns:1fr!important;gap:10px!important}
html.rb-layout-mobile .class-admin-mailbox-title .class-message-toolbar{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;width:100%!important}
html.rb-layout-mobile .class-admin-mailbox-title .class-message-toolbar a{display:grid!important;place-items:center!important;min-width:0!important;min-height:44px!important;padding:7px!important;text-align:center!important;white-space:normal!important}
html.rb-layout-mobile .class-admin-mailbox-level-head{display:grid!important;grid-template-columns:1fr!important;align-items:start!important;gap:10px!important}
html.rb-layout-mobile .class-admin-mailbox-search{width:100%!important}
html.rb-layout-mobile .class-admin-mailbox-identities,
html.rb-layout-mobile .class-admin-mailbox-conversations{grid-template-columns:1fr!important}
html.rb-layout-mobile .class-admin-mailbox-identity,
html.rb-layout-mobile .class-admin-mailbox-conversation{grid-template-columns:42px minmax(0,1fr) auto!important;min-height:78px!important;padding:10px!important}
html.rb-layout-mobile .class-admin-mailbox-back{width:100%!important;min-height:46px!important}
html.rb-layout-mobile .class-admin-audit-stream{max-height:none!important;min-height:55dvh!important;padding:12px 8px!important}
html.rb-layout-mobile .class-admin-audit-message{max-width:88%!important}

@media(max-width:420px){
  html.rb-layout-mobile .class-account-actions{grid-template-columns:1fr!important}
}

@media(max-width:520px){
  html.rb-layout-mobile .class-topbar h1{font-size:clamp(20px,6.5vw,27px)!important}
  html.rb-layout-mobile .class-topbar p{display:none!important}
}

/* ResearchBook 1.84 iOS PWA keyboard hotfix.
   In standalone WebKit, fixed-position surfaces are already attached to the
   visible viewport while the software keyboard is open. Re-applying
   visualViewport.offsetTop/offsetLeft therefore double-pans the whole chat and
   creates a large blank region above the conversation. Keep the live visual
   viewport HEIGHT, but zero the standalone PWA origin. Safari browser tabs keep
   the 1.79 offset-aware fallback above. */
html.rb-pwa-standalone.rb-layout-mobile.rb-ios.rb-virtual-keyboard-open .class-chat-overlay,
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 iPhone/PWA chat containment.
   The full-screen chat SURFACE never adopts visualViewport.height. Doing so can
   expose the dashboard when iOS emits a tiny transient viewport during keyboard
   animation. Keep the opaque shell at the stable pre-keyboard height and move
   only the composer above the keyboard with a bounded keyboard inset. */
html.rb-layout-mobile.rb-ios.rb181-chat-viewport-locked .class-chat-overlay,
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;
  max-width:none!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;
}
html.rb-layout-mobile.rb-ios.rb181-chat-viewport-locked .class-chat-overlay{
  background:#eef2f6!important;
}
html.rb-layout-mobile.rb-ios.rb181-chat-viewport-locked .rb176-research-chat-shell{
  background:#eef3f8!important;
  backdrop-filter:none!important;
}
html.rb-layout-mobile.rb-ios.rb181-chat-viewport-locked .class-chat-overlay-content,
html.rb-layout-mobile.rb-ios.rb181-chat-viewport-locked .class-chat-card.immersive,
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{
  width:100%!important;
  height:100%!important;
  min-height:0!important;
  max-height:100%!important;
}
html.rb-layout-mobile.rb-ios.rb181-chat-viewport-locked .class-chat-card.immersive .class-chat-layout{
  height:auto!important;
  min-height:0!important;
  max-height:none!important;
}
html.rb-layout-mobile.rb-ios.rb181-chat-viewport-locked .class-chat-card.immersive .class-chat-main{
  height:100%!important;
  min-height:0!important;
  overflow:hidden!important;
}
html.rb-layout-mobile.rb-ios.rb181-chat-viewport-locked.rb-virtual-keyboard-open .class-chat-card.immersive .class-chat-composer{
  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.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 .class-chat-card.immersive .class-chat-stream,
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;
}
/* Neutralise the 1.79/1.80 visual-viewport shell resize while a 1.84 viewport
   lock owns the chat. The variables are retained for diagnostics only. */
html.rb-layout-mobile.rb-ios.rb181-chat-viewport-locked.rb-virtual-keyboard-open .class-chat-overlay,
html.rb-layout-mobile.rb-ios.rb181-chat-viewport-locked.rb-virtual-keyboard-open .rb176-research-chat-shell{
  top:0!important;
  left:0!important;
  width:100vw!important;
  height:var(--rb181-chat-layout-height,100dvh)!important;
}

/* ResearchBook 1.84 iPhone/PWA chat keyboard layout.
   1.84 kept the shell full-height but put the keyboard height into composer
   padding. That padding was visible and scrollable as a large white block.
   1.84 keeps the opaque shell full-height, but sizes only the chat CONTENT to
   the settled visible viewport. The composer stays in normal document flow and
   receives no keyboard-height padding. */
html.rb-layout-mobile.rb-ios.rb182-chat-viewport-locked .class-chat-overlay,
html.rb-layout-mobile.rb-ios.rb182-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(--rb182-chat-layout-height,100dvh)!important;
  min-height:var(--rb182-chat-layout-height,100dvh)!important;max-height:var(--rb182-chat-layout-height,100dvh)!important;
  margin:0!important;overflow:hidden!important;overscroll-behavior:none!important;transform:none!important;
}
html.rb-layout-mobile.rb-ios.rb182-chat-viewport-locked .class-chat-overlay{background:#eef2f6!important;overscroll-behavior:none!important}
html.rb-layout-mobile.rb-ios.rb182-chat-viewport-locked .class-chat-overlay-content{
  position:relative!important;width:100%!important;height:100%!important;overflow:hidden!important;overscroll-behavior:none!important;
}
/* 1.84: teacher/student immersive chat uses the visual viewport BOTTOM
   (offsetTop + height), not height alone. This removes the real blank area that
   1.82 left below the composer whenever iOS panned the visual viewport. */
html.rb-layout-mobile.rb-ios.rb182-chat-viewport-locked .class-chat-card.immersive{
  width:100%!important;height:var(--rb183-class-chat-visible-bottom,var(--rb182-chat-layout-height,100dvh))!important;
  min-height:0!important;max-height:var(--rb183-class-chat-visible-bottom,var(--rb182-chat-layout-height,100dvh))!important;
  overflow:hidden!important;
}
html.rb-layout-mobile.rb-ios.rb182-chat-viewport-locked .class-chat-card.immersive .class-chat-layout,
html.rb-layout-mobile.rb-ios.rb182-chat-viewport-locked .class-chat-card.immersive .class-chat-main{
  min-height:0!important;max-height:100%!important;overflow:hidden!important;
}
html.rb-layout-mobile.rb-ios.rb182-chat-viewport-locked .class-chat-card.immersive .class-chat-main{
  height:100%!important;grid-template-rows:auto minmax(0,1fr) auto!important;
}
html.rb-layout-mobile.rb-ios.rb182-chat-viewport-locked .class-chat-card.immersive .class-chat-stream{
  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 .class-chat-card.immersive .class-chat-composer{
  position:relative!important;inset:auto!important;bottom:auto!important;margin:0!important;
  padding:9px!important;transform:none!important;
}
html.rb-layout-mobile.rb-ios.rb182-chat-viewport-locked .class-conversation-list{
  overscroll-behavior:contain!important;-webkit-overflow-scrolling:touch!important;
}
