/* TEST2 browser layout only. Existing controls, viewport and settings own behavior. */
.rooomTest2AdRail,.rooomTest2AdMobile{display:none;pointer-events:none}
html[data-rooom-test2-ad-preview]{--ad-page-width:calc(100vw - 24px);--ad-page-left:12px;--ad-room-width:calc(100vw - 358px)}
html[data-rooom-test2-ad-preview="room"]{--ad-bottom-safe:var(--rooom-safe-bottom,0px)}
html[data-rooom-test2-ad-preview="room"].rooom-keyboard-open{--ad-bottom-safe:0px}
html[data-rooom-test2-ad-preview] .rooomTest2AdRail{box-sizing:border-box;min-width:0;border:1px dashed #adb4c4;border-radius:16px;background:rgba(127,139,161,.065);color:var(--text,#20242b);padding:8px;overflow:auto}
html[data-rooom-test2-ad-preview] .rooomTest2AdRailHead{font:700 13px/1.5 system-ui,sans-serif;margin-bottom:16px}
html[data-rooom-test2-ad-preview] .rooomTest2AdRailFrame{box-sizing:border-box;width:min(300px,100%);aspect-ratio:6/5;border-radius:12px;background:#e3e8ef;border:1px dashed #7a8798;display:flex;align-items:center;justify-content:center;color:#3e4957;text-align:center;font:700 14px system-ui,sans-serif;padding:10px}
html[data-rooom-test2-ad-preview] .rooomTest2AdRailNote{font:12px/1.6 system-ui,sans-serif;opacity:.75;margin:12px 0 0}
html[data-rooom-test2-ad-preview] .rooomTest2AdMobile{box-sizing:border-box;min-width:0;min-height:50px;align-items:center;justify-content:center;background:var(--bg,#fff)}
html[data-rooom-test2-ad-preview] .rooomTest2AdMobileFrame{box-sizing:border-box;height:50px;width:min(320px,100%);background:#e3e8ef;border:1px dashed #7a8798;border-radius:8px;color:#3e4957;display:flex;align-items:center;justify-content:center;font:700 12px/1.2 system-ui,sans-serif}
@media(min-width:700px){
 html[data-rooom-test2-ad-preview="room"] .app,
 html[data-rooom-test2-ad-preview="room"].ios-ipad-landscape .app{display:grid!important;grid-template-columns:minmax(0,1fr) 318px!important;grid-template-rows:auto minmax(0,1fr)!important;gap:7px 16px!important;padding:0!important;min-height:0!important}
 /* Keyboard geometry remains entirely with room-layout-controller.js. */
 html[data-rooom-test2-ad-preview="room"]:not(.rooom-room-layout-lock) .app,
 html[data-rooom-test2-ad-preview="room"].ios-ipad-landscape:not(.rooom-room-layout-lock) .app{width:var(--ad-page-width)!important;height:min(820px,calc(100dvh - 24px))!important;max-width:none!important;max-height:none!important;position:relative!important;inset:auto!important}
 html[data-rooom-test2-ad-preview="room"] .app>.sidebar{box-sizing:border-box;width:100%!important;min-width:0!important;grid-column:1!important;grid-row:1!important;display:grid!important;grid-template-columns:minmax(0,1fr) 36px 36px!important;align-items:center!important;gap:8px!important;padding:9px 11px!important;overflow:visible!important;border-radius:16px!important}
 html[data-rooom-test2-ad-preview="room"] .sidebar .titleRow{grid-column:1!important;grid-row:1!important;min-width:0!important}
 html[data-rooom-test2-ad-preview="room"] .sidebar h1{font-size:14px!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
 html[data-rooom-test2-ad-preview="room"] .sidebar .sub{display:block!important;margin:4px 0 0;font-size:12px;max-height:64px;overflow:auto;overflow-wrap:anywhere}
 html[data-rooom-test2-ad-preview="room"] .sidebar .backBtn{grid-column:2!important;grid-row:1!important;position:relative!important;inset:auto!important;width:36px!important;min-width:36px!important;height:36px!important;padding:0!important;font-size:0!important;line-height:0!important}
 html[data-rooom-test2-ad-preview="room"] .sidebar .backBtn::before{content:"←"!important;display:flex!important;align-items:center;justify-content:center;width:100%;height:100%;font-size:18px!important;line-height:1}
 html[data-rooom-test2-ad-preview="room"] .sidebar .settingsWrap{display:contents!important}
 html[data-rooom-test2-ad-preview="room"] .sidebar #toggleSettingsBtn{grid-column:3!important;grid-row:1!important;width:36px!important;min-width:36px!important;height:36px!important;padding:0!important;font-size:0!important;line-height:0!important}
 html[data-rooom-test2-ad-preview="room"] .sidebar #toggleSettingsBtn::before{content:"⚙"!important;display:flex!important;width:100%;height:100%;align-items:center;justify-content:center;font-size:18px!important;line-height:1}
 html[data-rooom-test2-ad-preview="room"] .sidebar #settingsBox{grid-column:1/-1!important;grid-row:2!important}
 html[data-rooom-test2-ad-preview="room"]:not(.rooom-settings-adaptive) .sidebar #settingsBox{max-height:min(50dvh,400px)!important;overflow:auto!important}
 html[data-rooom-test2-ad-preview="room"] .app>.chat{grid-column:1!important;grid-row:2!important;min-height:0!important;width:100%!important;flex:none!important;border-radius:16px!important}
 html[data-rooom-test2-ad-preview="room"] .app>.chat .chatHeader{display:none!important}
 html[data-rooom-test2-ad-preview="room"] .app>.rooomTest2AdRailPrimary{display:block;grid-column:2;grid-row:1/3;padding:8px}
 html[data-rooom-test2-ad-preview="room"].ios-ipad-landscape .app>.sidebar{grid-template-columns:minmax(0,1fr) 36px 36px 36px!important}
 html[data-rooom-test2-ad-preview="room"] .sidebar>.ipadLandscapeReloadBtn{grid-column:4;grid-row:1}
 html[data-rooom-test2-ad-preview="home"] #pageFade{width:var(--ad-page-width)!important;min-width:0;margin:0 0 0 var(--ad-page-left);display:grid!important;grid-template-columns:minmax(0,1fr) 318px;align-items:start;gap:16px}
 html[data-rooom-test2-ad-preview="home"] #pageFade>.wrap{width:100%!important;min-width:0!important;margin:0!important}
 html[data-rooom-test2-ad-preview="home"] #pageFade>.rooomTest2AdRailPrimary{display:block;position:sticky;top:16px;min-height:400px;margin-top:16px;padding:8px}
 html[data-rooom-test2-ad-preview="home"] .rooomFloatingActionDock{left:calc(var(--ad-page-left) + 8px)!important;right:auto!important}
 html[data-rooom-test2-ad-preview="home"].rooom-create-dock-right .rooomFloatingActionDock{left:auto!important;right:calc(100vw - var(--ad-page-left) - var(--ad-room-width) + 8px)!important}
 html[data-rooom-test2-ad-preview="home"] #pageFade .grid{grid-template-columns:minmax(0,1fr)!important}
}
@media(max-width:699px){
 html[data-rooom-test2-ad-preview="room"] .app{grid-template-rows:auto minmax(0,1fr) calc(50px + var(--ad-bottom-safe))!important;padding:6px 0 0!important}
 html[data-rooom-test2-ad-preview="room"] .app>.sidebar,
 html[data-rooom-test2-ad-preview="room"] .app>.chat{width:calc(100% - 12px)!important;margin:0 6px}
 html[data-rooom-test2-ad-preview="room"] .app>.rooomTest2AdMobile{display:flex;grid-row:3;min-height:0;padding-bottom:var(--ad-bottom-safe)}
 html[data-rooom-test2-ad-preview="home"] body>.rooomTest2AdMobile{display:flex;position:fixed;left:0;right:0;bottom:0;padding-bottom:var(--rooom-safe-bottom,0px);z-index:1000}
 html[data-rooom-test2-ad-preview="home"] .rooomFloatingActionDock,
 html[data-rooom-test2-ad-preview="home"].rooom-create-dock-right .rooomFloatingActionDock{bottom:calc(var(--rooom-safe-bottom,0px) + 60px)!important}
 html[data-rooom-test2-ad-preview="home"] .wrap{padding-bottom:calc(160px + var(--rooom-safe-bottom,0px))!important}
 /* Split-view iPad landscape still uses the narrow screen, with existing buttons. */
 html[data-rooom-test2-ad-preview="room"].ios-ipad-landscape .app{display:grid!important;width:100vw!important;gap:6px!important;grid-template-columns:minmax(0,1fr)!important;grid-template-rows:auto minmax(0,1fr) calc(50px + var(--ad-bottom-safe))!important}
 html[data-rooom-test2-ad-preview="room"].ios-ipad-landscape:not(.rooom-room-layout-lock) .app{height:100dvh!important}
 html[data-rooom-test2-ad-preview="room"].ios-ipad-landscape .sidebar{display:grid!important;grid-template-columns:36px minmax(0,1fr) 36px 36px!important;gap:6px!important;padding:8px!important}
 html[data-rooom-test2-ad-preview="room"].ios-ipad-landscape .sidebar .titleRow{grid-column:2!important;grid-row:1!important}
 html[data-rooom-test2-ad-preview="room"].ios-ipad-landscape .sidebar h1{font-size:14px!important}
 html[data-rooom-test2-ad-preview="room"].ios-ipad-landscape .sidebar .sub{display:none!important}
 html[data-rooom-test2-ad-preview="room"].ios-ipad-landscape .sidebar .settingsWrap{display:contents!important}
 html[data-rooom-test2-ad-preview="room"].ios-ipad-landscape .sidebar .backBtn{grid-column:1!important;grid-row:1!important;width:36px!important;min-width:36px!important;height:36px!important;padding:0!important;font-size:0!important}
 html[data-rooom-test2-ad-preview="room"].ios-ipad-landscape .sidebar .backBtn::before{content:"←"!important;display:flex!important;align-items:center;justify-content:center;font-size:18px!important}
 html[data-rooom-test2-ad-preview="room"].ios-ipad-landscape #toggleSettingsBtn{grid-column:3!important;grid-row:1!important;width:36px!important;min-width:36px!important;height:36px!important;padding:0!important;font-size:0!important}
 html[data-rooom-test2-ad-preview="room"].ios-ipad-landscape #toggleSettingsBtn::before{content:"⚙"!important;display:flex!important;align-items:center;justify-content:center;font-size:18px!important}
 html[data-rooom-test2-ad-preview="room"].ios-ipad-landscape .sidebar>.ipadLandscapeReloadBtn{grid-column:4!important;grid-row:1!important}
 html[data-rooom-test2-ad-preview="room"].ios-ipad-landscape #settingsBox{grid-column:1/-1!important}
 html[data-rooom-test2-ad-preview="room"].ios-ipad-landscape .chatHeader{display:none!important}
 /* In short split-view keyboards, preserve all controls and the 50px slot by
    reducing decoration spacing, not the viewport owner's height or input. */
 html[data-rooom-test2-ad-preview="room"].ios-ipad-landscape.rooom-keyboard-open .app>.sidebar{padding-top:4px!important;padding-bottom:4px!important}
 html[data-rooom-test2-ad-preview="room"].ios-ipad-landscape.rooom-keyboard-open .app>.chat .chatBox{padding-top:0!important;padding-bottom:0!important}
}


/* TEST2 browser-only fluid layout: minimum room 320px, creative 300x250.
   700px: 342 room + 318 rail + 16 gap + 24 gutters.
   1080px: 388 room + 636 rails + 32 gaps + 24 gutters. */
@media(min-width:700px){
 html[data-rooom-test2-ad-preview="room"] body,
 html[data-rooom-test2-ad-preview="room"].ios-ipad-landscape body{
  justify-content:flex-start!important;
 }
 html[data-rooom-test2-ad-preview="room"] .app,
 html[data-rooom-test2-ad-preview="room"].ios-ipad-landscape .app{
  margin-left:0!important;margin-right:auto!important;
 }
 html[data-rooom-test2-ad-preview="room"].ios-ipad-landscape .sidebar .backBtn::before{
  content:"←"!important;display:flex!important;align-items:center;justify-content:center;
 }
 html[data-rooom-test2-ad-preview="room"].ios-ipad-landscape #toggleSettingsBtn::before{
  content:"⚙"!important;display:flex!important;align-items:center;justify-content:center;
 }
}
@media(min-width:700px) and (max-width:860px){
 html[data-rooom-test2-ad-preview="room"] .app,
 html[data-rooom-test2-ad-preview="room"].ios-ipad-landscape .app{
  margin-left:12px!important;
 }
}
@media(min-width:1080px){
 html[data-rooom-test2-ad-preview]{--ad-room-width:calc(100vw - 692px)}
 html[data-rooom-test2-ad-preview="room"] .app,
 html[data-rooom-test2-ad-preview="room"].ios-ipad-landscape .app{
  grid-template-columns:minmax(0,1fr) 318px 318px!important;
 }
 html[data-rooom-test2-ad-preview="home"] #pageFade{
  grid-template-columns:minmax(0,1fr) 318px 318px;
 }
 html[data-rooom-test2-ad-preview="room"] .app>.rooomTest2AdRailSecondary{
  display:block;grid-column:3;grid-row:1/3;
 }
 html[data-rooom-test2-ad-preview="home"] #pageFade>.rooomTest2AdRailSecondary{
  display:block;grid-column:3;grid-row:1;
  position:sticky;top:16px;min-height:400px;margin-top:16px;
 }
}


/* TEST2 only: keep the room shell's geometry continuous across room.css's
   legacy 860/861px mobile/desktop boundary. The ad columns themselves still
   switch at 700px and 1240px. Do not replace the keyboard viewport owner's
   positioning while rooom-room-layout-lock is active. */
@media(min-width:700px){
 html[data-rooom-test2-ad-preview="room"] body,
 html[data-rooom-test2-ad-preview="room"].ios-ipad-landscape body{
  position:fixed!important;
  inset:0!important;
  width:100%!important;
  height:100%!important;
  max-height:100%!important;
  padding:0!important;
  align-items:stretch!important;
  justify-content:flex-start!important;
  overflow:hidden!important;
 }
 html[data-rooom-test2-ad-preview="room"]:not(.rooom-room-layout-lock) .app,
 html[data-rooom-test2-ad-preview="room"].ios-ipad-landscape:not(.rooom-room-layout-lock) .app{
  width:calc(100vw - 24px)!important;
  height:100dvh!important;
  min-height:0!important;
  max-height:none!important;
  position:relative!important;
  inset:auto!important;
  margin:0 12px!important;
  overflow:hidden!important;
 }
 html[data-rooom-test2-ad-preview="room"] .app>.chat{
  display:flex!important;
  flex-direction:column!important;
  min-height:0!important;
  overflow:hidden!important;
 }
 html[data-rooom-test2-ad-preview="room"] .app>.chat .chatBox{
  flex:1 1 0!important;
  min-height:0!important;
  overflow:auto!important;
 }
}

/* TEST2 room header: retain the mobile arrangement at all screen widths.
   Only the room header is changed; the source subtitle and controls remain
   available to their existing owners. No TOP, production or Native changes. */
@media(min-width:700px){
 html[data-rooom-test2-ad-preview="room"] .app>.sidebar{
  display:grid!important;
  grid-template-columns:36px minmax(0,1fr) 36px!important;
  align-items:center!important;
  gap:8px!important;
  padding:8px 10px!important;
 }
 html[data-rooom-test2-ad-preview="room"] .app>.sidebar .titleRow{
  grid-column:2!important;grid-row:1!important;
  min-width:0!important;align-items:center!important;padding-left:0!important;
 }
 html[data-rooom-test2-ad-preview="room"] .app>.sidebar .titleBlock{
  min-width:0!important;width:100%!important;
 }
 html[data-rooom-test2-ad-preview="room"] .app>.sidebar #pageTitle{
  font-size:13px!important;line-height:1.2!important;font-weight:800!important;
  white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;
 }
 html[data-rooom-test2-ad-preview="room"] .app>.sidebar #pageSubtitle,
 html[data-rooom-test2-ad-preview="room"] .app>.sidebar .sub{
  display:none!important;
 }
 html[data-rooom-test2-ad-preview="room"] .app>.sidebar .backBtn{
  grid-column:1!important;grid-row:1!important;
 }
 html[data-rooom-test2-ad-preview="room"] .app>.sidebar .settingsWrap{
  display:contents!important;
 }
 html[data-rooom-test2-ad-preview="room"] .app>.sidebar #toggleSettingsBtn{
  grid-column:3!important;grid-row:1!important;
 }
 html[data-rooom-test2-ad-preview="room"] .app>.sidebar #settingsBox{
  grid-column:1/-1!important;grid-row:2!important;
 }
 /* Retain the existing fourth iPad reload control in both orientations. */
 html[data-rooom-test2-ad-preview="room"].ios-device:not(.ios-ipad-landscape) .app>.sidebar:has(.ipadPortraitReloadBtn:not([hidden])){
  grid-template-columns:36px minmax(0,1fr) 36px 36px!important;
 }
 html[data-rooom-test2-ad-preview="room"].ios-device.ios-ipad-landscape .app>.sidebar{
  display:grid!important;
  grid-template-columns:36px minmax(0,1fr) 36px 36px!important;
  padding:8px 10px!important;
  align-items:center!important;gap:8px!important;
  overflow:visible!important;
 }
 html[data-rooom-test2-ad-preview="room"].ios-device.ios-ipad-landscape .app>.sidebar .backBtn,
 html[data-rooom-test2-ad-preview="room"].ios-device.ios-ipad-landscape .app>.sidebar #toggleSettingsBtn{
  width:36px!important;min-width:36px!important;height:36px!important;
  padding:0!important;font-size:0!important;line-height:0!important;
 }
 html[data-rooom-test2-ad-preview="room"].ios-device.ios-ipad-landscape .app>.sidebar .backBtn::before{
  content:"←"!important;display:flex!important;align-items:center!important;
  justify-content:center!important;font-size:18px!important;line-height:1!important;
 }
 html[data-rooom-test2-ad-preview="room"].ios-device.ios-ipad-landscape .app>.sidebar #toggleSettingsBtn::before{
  content:"⚙"!important;display:flex!important;align-items:center!important;
  justify-content:center!important;font-size:17px!important;line-height:1!important;
 }
 html[data-rooom-test2-ad-preview="room"].ios-device.ios-ipad-landscape .app>.sidebar .ipadLandscapeReloadBtn{
  grid-column:4!important;grid-row:1!important;
 }
}


/* TEST2 visual experiment only: one common room top gutter, then a centered
   conversation with a 300x250 ad on each side when there is enough room.
   This does not change room.css, runtime behavior, protected routing, or ads.
   Virtual keyboard geometry is still owned by room-layout-controller.js. */
html[data-rooom-test2-ad-preview="room"]:not(.rooom-keyboard-open) .app{
 padding-top:10px!important;
}
@media(min-width:700px) and (max-width:1079px){
 /* Keep the single side rail; stop stretching conversations beyond 680px. */
 html[data-rooom-test2-ad-preview]{
  --ad-page-width:min(1014px,calc(100vw - 24px));
  --ad-room-width:min(680px,calc(100vw - 358px));
 }
 html[data-rooom-test2-ad-preview="room"]:not(.rooom-room-layout-lock) .app,
 html[data-rooom-test2-ad-preview="room"].ios-ipad-landscape:not(.rooom-room-layout-lock) .app{
  width:var(--ad-page-width)!important;
  max-width:1014px!important;
 }
}
@media(min-width:1080px){
 /* Two fixed 318px ad rails, 16px gaps, and a fluid center (388-680px). */
 html[data-rooom-test2-ad-preview]{
  --ad-page-width:min(1348px,calc(100vw - 24px));
  --ad-page-left:max(12px,calc((100vw - 1348px)/2));
  --ad-room-width:calc(var(--ad-page-width) - 668px);
 }
 html[data-rooom-test2-ad-preview="room"] .app,
 html[data-rooom-test2-ad-preview="room"].ios-ipad-landscape .app{
  grid-template-columns:318px minmax(0,1fr) 318px!important;
  column-gap:16px!important;
 }
 html[data-rooom-test2-ad-preview="room"]:not(.rooom-room-layout-lock) .app,
 html[data-rooom-test2-ad-preview="room"].ios-ipad-landscape:not(.rooom-room-layout-lock) .app{
  width:var(--ad-page-width)!important;
  max-width:1348px!important;
  margin-left:auto!important;
  margin-right:auto!important;
 }
 html[data-rooom-test2-ad-preview="room"] .app>.sidebar,
 html[data-rooom-test2-ad-preview="room"] .app>.chat{
  grid-column:2!important;
 }
 html[data-rooom-test2-ad-preview="room"] .app>.rooomTest2AdRailPrimary{
  display:block!important;
  grid-column:1!important;
  grid-row:1/3!important;
 }
 html[data-rooom-test2-ad-preview="room"] .app>.rooomTest2AdRailSecondary{
  display:block!important;
  grid-column:3!important;
  grid-row:1/3!important;
 }
 /* The creative is only 300x250; do not paint a tall empty ad column. */
 html[data-rooom-test2-ad-preview] .rooomTest2AdRail{
  align-self:start!important;
  min-height:0!important;
 }
 html[data-rooom-test2-ad-preview="home"] #pageFade{
  width:var(--ad-page-width)!important;
  grid-template-columns:318px minmax(0,1fr) 318px!important;
  margin-left:var(--ad-page-left)!important;
  margin-right:0!important;
 }
 html[data-rooom-test2-ad-preview="home"] #pageFade>.wrap{
  grid-column:2!important;
  grid-row:1!important;
 }
 html[data-rooom-test2-ad-preview="home"] #pageFade>.rooomTest2AdRailPrimary{
  grid-column:1!important;
  grid-row:1!important;
 }
 html[data-rooom-test2-ad-preview="home"] #pageFade>.rooomTest2AdRailSecondary{
  grid-column:3!important;
  grid-row:1!important;
 }
 /* Floating create actions stay anchored inside the central home content. */
 html[data-rooom-test2-ad-preview="home"] .rooomFloatingActionDock{
  left:calc(var(--ad-page-left) + 342px)!important;
  right:auto!important;
 }
 html[data-rooom-test2-ad-preview="home"].rooom-create-dock-right .rooomFloatingActionDock{
  left:auto!important;
  right:calc(var(--ad-page-left) + 342px)!important;
 }
}


/* TEST2 device-aware ad layout. Keep the existing room.html ipad-device class
   as a no-JS-update fallback for iPad Safari, while the JS device attribute
   covers Android tablets. This is browser-preview-only; Native is excluded.
   Width and orientation still decide whether a side ad fits. */
@media(min-width:700px){
 /* Even in landscape, a phone keeps the 320x50 bottom placement. */

 html[data-rooom-test2-ad-device="phone"][data-rooom-test2-ad-preview="room"] .app{
  display:grid!important;
  grid-template-columns:minmax(0,1fr)!important;
  grid-template-rows:auto minmax(0,1fr) calc(50px + var(--ad-bottom-safe))!important;
  gap:6px!important;
  padding:10px 0 0!important;
  min-height:0!important;
 }
 html[data-rooom-test2-ad-device="phone"][data-rooom-test2-ad-preview="room"].rooom-keyboard-open .app{padding-top:0!important}
 html[data-rooom-test2-ad-device="phone"][data-rooom-test2-ad-preview="room"]:not(.rooom-room-layout-lock) .app{
  width:100vw!important;
  max-width:none!important;
  height:100dvh!important;
  max-height:none!important;
  margin:0!important;
  position:relative!important;
  inset:auto!important;
  overflow:hidden!important;
 }
 html[data-rooom-test2-ad-device="phone"][data-rooom-test2-ad-preview="room"] .app>.sidebar,
 html[data-rooom-test2-ad-device="phone"][data-rooom-test2-ad-preview="room"] .app>.chat{
  grid-column:1!important;
  width:calc(100% - 12px)!important;
  min-width:0!important;
  margin:0 6px!important;
 }
 html[data-rooom-test2-ad-device="phone"][data-rooom-test2-ad-preview="room"] .app>.sidebar{grid-row:1!important}
 html[data-rooom-test2-ad-device="phone"][data-rooom-test2-ad-preview="room"] .app>.chat{grid-row:2!important}
 html[data-rooom-test2-ad-device="phone"][data-rooom-test2-ad-preview="room"] .app>.rooomTest2AdRail{display:none!important}
 html[data-rooom-test2-ad-device="phone"][data-rooom-test2-ad-preview="room"] .app>.rooomTest2AdMobile{
  display:flex!important;
  grid-column:1!important;
  grid-row:3!important;
  min-height:0!important;
  padding-bottom:var(--ad-bottom-safe)!important;
 }
 html[data-rooom-test2-ad-device="phone"][data-rooom-test2-ad-preview="home"] #pageFade{
  display:block!important;
  width:100%!important;
  max-width:none!important;
  min-width:0!important;
  margin:0!important;
 }
 html[data-rooom-test2-ad-device="phone"][data-rooom-test2-ad-preview="home"] #pageFade>.wrap{
  width:100%!important;
  min-width:0!important;
  margin:0 auto!important;
 }
 html[data-rooom-test2-ad-device="phone"][data-rooom-test2-ad-preview="home"] #pageFade>.rooomTest2AdRail{display:none!important}
 html[data-rooom-test2-ad-device="phone"][data-rooom-test2-ad-preview="home"] body>.rooomTest2AdMobile{
  display:flex!important;
  position:fixed!important;
  left:0!important;right:0!important;bottom:0!important;
  padding-bottom:var(--rooom-safe-bottom,0px)!important;
  z-index:1000!important;
 }
 html[data-rooom-test2-ad-device="phone"][data-rooom-test2-ad-preview="home"] .rooomFloatingActionDock{
  left:12px!important;right:auto!important;
  bottom:calc(var(--rooom-safe-bottom,0px) + 60px)!important;
 }
 html[data-rooom-test2-ad-device="phone"][data-rooom-test2-ad-preview="home"].rooom-create-dock-right .rooomFloatingActionDock{
  left:auto!important;right:12px!important;
 }
 html[data-rooom-test2-ad-device="phone"][data-rooom-test2-ad-preview="home"] .wrap{
  padding-bottom:calc(160px + var(--rooom-safe-bottom,0px))!important;
 }

}
/* Full-width tablet portrait, including large iPads with width >=700px. */
@media(min-width:700px) and (orientation:portrait){

 html:is(.ipad-device.ios-device, [data-rooom-test2-ad-device="tablet"])[data-rooom-test2-ad-preview="room"] .app{
  display:grid!important;
  grid-template-columns:minmax(0,1fr)!important;
  grid-template-rows:auto minmax(0,1fr) calc(50px + var(--ad-bottom-safe))!important;
  gap:6px!important;
  padding:10px 0 0!important;
  min-height:0!important;
 }
 html:is(.ipad-device.ios-device, [data-rooom-test2-ad-device="tablet"])[data-rooom-test2-ad-preview="room"].rooom-keyboard-open .app{padding-top:0!important}
 html:is(.ipad-device.ios-device, [data-rooom-test2-ad-device="tablet"])[data-rooom-test2-ad-preview="room"]:not(.rooom-room-layout-lock) .app{
  width:100vw!important;
  max-width:none!important;
  height:100dvh!important;
  max-height:none!important;
  margin:0!important;
  position:relative!important;
  inset:auto!important;
  overflow:hidden!important;
 }
 html:is(.ipad-device.ios-device, [data-rooom-test2-ad-device="tablet"])[data-rooom-test2-ad-preview="room"] .app>.sidebar,
 html:is(.ipad-device.ios-device, [data-rooom-test2-ad-device="tablet"])[data-rooom-test2-ad-preview="room"] .app>.chat{
  grid-column:1!important;
  width:calc(100% - 12px)!important;
  min-width:0!important;
  margin:0 6px!important;
 }
 html:is(.ipad-device.ios-device, [data-rooom-test2-ad-device="tablet"])[data-rooom-test2-ad-preview="room"] .app>.sidebar{grid-row:1!important}
 html:is(.ipad-device.ios-device, [data-rooom-test2-ad-device="tablet"])[data-rooom-test2-ad-preview="room"] .app>.chat{grid-row:2!important}
 html:is(.ipad-device.ios-device, [data-rooom-test2-ad-device="tablet"])[data-rooom-test2-ad-preview="room"] .app>.rooomTest2AdRail{display:none!important}
 html:is(.ipad-device.ios-device, [data-rooom-test2-ad-device="tablet"])[data-rooom-test2-ad-preview="room"] .app>.rooomTest2AdMobile{
  display:flex!important;
  grid-column:1!important;
  grid-row:3!important;
  min-height:0!important;
  padding-bottom:var(--ad-bottom-safe)!important;
 }
 html:is(.ipad-device.ios-device, [data-rooom-test2-ad-device="tablet"])[data-rooom-test2-ad-preview="home"] #pageFade{
  display:block!important;
  width:100%!important;
  max-width:none!important;
  min-width:0!important;
  margin:0!important;
 }
 html:is(.ipad-device.ios-device, [data-rooom-test2-ad-device="tablet"])[data-rooom-test2-ad-preview="home"] #pageFade>.wrap{
  width:100%!important;
  min-width:0!important;
  margin:0 auto!important;
 }
 html:is(.ipad-device.ios-device, [data-rooom-test2-ad-device="tablet"])[data-rooom-test2-ad-preview="home"] #pageFade>.rooomTest2AdRail{display:none!important}
 html:is(.ipad-device.ios-device, [data-rooom-test2-ad-device="tablet"])[data-rooom-test2-ad-preview="home"] body>.rooomTest2AdMobile{
  display:flex!important;
  position:fixed!important;
  left:0!important;right:0!important;bottom:0!important;
  padding-bottom:var(--rooom-safe-bottom,0px)!important;
  z-index:1000!important;
 }
 html:is(.ipad-device.ios-device, [data-rooom-test2-ad-device="tablet"])[data-rooom-test2-ad-preview="home"] .rooomFloatingActionDock{
  left:12px!important;right:auto!important;
  bottom:calc(var(--rooom-safe-bottom,0px) + 60px)!important;
 }
 html:is(.ipad-device.ios-device, [data-rooom-test2-ad-device="tablet"])[data-rooom-test2-ad-preview="home"].rooom-create-dock-right .rooomFloatingActionDock{
  left:auto!important;right:12px!important;
 }
 html:is(.ipad-device.ios-device, [data-rooom-test2-ad-device="tablet"])[data-rooom-test2-ad-preview="home"] .wrap{
  padding-bottom:calc(160px + var(--rooom-safe-bottom,0px))!important;
 }

}

/* Tablet LANDSCAPE only: left ad + right-hand room. Never shrink ad creatives.
   >=700px ensures at least 342px for chat at the narrow edge. */
@media(min-width:700px) and (orientation:landscape){
 html:is(.ipad-device.ios-device, [data-rooom-test2-ad-device="tablet"])[data-rooom-test2-ad-preview]{
  --ad-page-width:min(1014px,calc(100vw - 24px));
  --ad-room-width:calc(var(--ad-page-width) - 334px);
 }
 html:is(.ipad-device.ios-device, [data-rooom-test2-ad-device="tablet"])[data-rooom-test2-ad-preview="room"] .app{
  display:grid!important;
  grid-template-columns:318px minmax(0,1fr)!important;
  grid-template-rows:auto minmax(0,1fr)!important;
  column-gap:16px!important;
  row-gap:7px!important;
  padding:10px 0 0!important;
  min-height:0!important;
 }
 html:is(.ipad-device.ios-device, [data-rooom-test2-ad-device="tablet"])[data-rooom-test2-ad-preview="room"]:not(.rooom-room-layout-lock) .app{
  width:var(--ad-page-width)!important;
  max-width:1014px!important;
  height:100dvh!important;
  max-height:none!important;
  margin:0 auto!important;
  position:relative!important;
  inset:auto!important;
  overflow:hidden!important;
 }
 html:is(.ipad-device.ios-device, [data-rooom-test2-ad-device="tablet"])[data-rooom-test2-ad-preview="room"] .app>.sidebar,
 html:is(.ipad-device.ios-device, [data-rooom-test2-ad-device="tablet"])[data-rooom-test2-ad-preview="room"] .app>.chat{
  grid-column:2!important;
  width:100%!important;
  min-width:0!important;
  margin:0!important;
 }
 html:is(.ipad-device.ios-device, [data-rooom-test2-ad-device="tablet"])[data-rooom-test2-ad-preview="room"] .app>.sidebar{grid-row:1!important}
 html:is(.ipad-device.ios-device, [data-rooom-test2-ad-device="tablet"])[data-rooom-test2-ad-preview="room"] .app>.chat{grid-row:2!important}
 html:is(.ipad-device.ios-device, [data-rooom-test2-ad-device="tablet"])[data-rooom-test2-ad-preview="room"] .app>.rooomTest2AdRailPrimary{
  display:block!important;grid-column:1!important;grid-row:1/3!important;
  align-self:start!important;min-height:0!important;
 }
 html:is(.ipad-device.ios-device, [data-rooom-test2-ad-device="tablet"])[data-rooom-test2-ad-preview="room"] .app>.rooomTest2AdRailSecondary{
  display:none!important;
 }
 html:is(.ipad-device.ios-device, [data-rooom-test2-ad-device="tablet"])[data-rooom-test2-ad-preview="room"] .app>.rooomTest2AdMobile{
  display:none!important;
 }
 html:is(.ipad-device.ios-device, [data-rooom-test2-ad-device="tablet"])[data-rooom-test2-ad-preview="home"] #pageFade{
  display:grid!important;
  width:var(--ad-page-width)!important;
  max-width:1014px!important;
  grid-template-columns:318px minmax(0,1fr)!important;
  gap:16px!important;
  margin:0 auto!important;
 }
 html:is(.ipad-device.ios-device, [data-rooom-test2-ad-device="tablet"])[data-rooom-test2-ad-preview="home"] #pageFade>.wrap{
  grid-column:2!important;
  grid-row:1!important;
  width:100%!important;
  min-width:0!important;
 }
 html:is(.ipad-device.ios-device, [data-rooom-test2-ad-device="tablet"])[data-rooom-test2-ad-preview="home"] #pageFade>.rooomTest2AdRailPrimary{
  display:block!important;grid-column:1!important;grid-row:1!important;
  align-self:start!important;min-height:0!important;
 }
 html:is(.ipad-device.ios-device, [data-rooom-test2-ad-device="tablet"])[data-rooom-test2-ad-preview="home"] #pageFade>.rooomTest2AdRailSecondary{
  display:none!important;
 }
 html:is(.ipad-device.ios-device, [data-rooom-test2-ad-device="tablet"])[data-rooom-test2-ad-preview="home"] body>.rooomTest2AdMobile{
  display:none!important;
 }
 html:is(.ipad-device.ios-device, [data-rooom-test2-ad-device="tablet"])[data-rooom-test2-ad-preview="home"] .rooomFloatingActionDock{
  left:calc(max(12px,(100vw - 1014px)/2) + 342px)!important;
  right:auto!important;
 }
 html:is(.ipad-device.ios-device, [data-rooom-test2-ad-device="tablet"])[data-rooom-test2-ad-preview="home"].rooom-create-dock-right .rooomFloatingActionDock{
  left:auto!important;right:max(12px,calc((100vw - 1014px)/2))!important;
 }
}



/* TEST2 HOME iPadOS fallback: index.html already marks iOS as rooom-ios.
   min-width+min-height distinguish tablet Safari from phone landscape
   without changing production markup. Use this only if newer device
   classification JS has not been refreshed. */
@media(min-width:700px) and (min-height:600px) and (orientation:portrait){
 html.rooom-ios[data-rooom-test2-ad-preview="home"]:not([data-rooom-test2-ad-device="tablet"]):not([data-rooom-test2-ad-device="phone"]) #pageFade{
  display:block!important;width:100%!important;max-width:none!important;
  min-width:0!important;margin:0!important;
 }
 html.rooom-ios[data-rooom-test2-ad-preview="home"]:not([data-rooom-test2-ad-device="tablet"]):not([data-rooom-test2-ad-device="phone"]) #pageFade>.wrap{
  width:100%!important;min-width:0!important;margin:0 auto!important;
 }
 html.rooom-ios[data-rooom-test2-ad-preview="home"]:not([data-rooom-test2-ad-device="tablet"]):not([data-rooom-test2-ad-device="phone"]) #pageFade>.rooomTest2AdRail{display:none!important}
 html.rooom-ios[data-rooom-test2-ad-preview="home"]:not([data-rooom-test2-ad-device="tablet"]):not([data-rooom-test2-ad-device="phone"]) body>.rooomTest2AdMobile{
  display:flex!important;position:fixed!important;left:0!important;
  right:0!important;bottom:0!important;z-index:1000!important;
 }
}
@media(min-width:700px) and (min-height:600px) and (orientation:landscape){
 html.rooom-ios[data-rooom-test2-ad-preview="home"]:not([data-rooom-test2-ad-device="tablet"]):not([data-rooom-test2-ad-device="phone"]){
  --ad-page-width:min(1014px,calc(100vw - 24px));
 }
 html.rooom-ios[data-rooom-test2-ad-preview="home"]:not([data-rooom-test2-ad-device="tablet"]):not([data-rooom-test2-ad-device="phone"]) #pageFade{
  display:grid!important;width:var(--ad-page-width)!important;max-width:1014px!important;
  grid-template-columns:318px minmax(0,1fr)!important;gap:16px!important;
  margin:0 auto!important;
 }
 html.rooom-ios[data-rooom-test2-ad-preview="home"]:not([data-rooom-test2-ad-device="tablet"]):not([data-rooom-test2-ad-device="phone"]) #pageFade>.wrap{
  grid-column:2!important;grid-row:1!important;width:100%!important;min-width:0!important;
 }
 html.rooom-ios[data-rooom-test2-ad-preview="home"]:not([data-rooom-test2-ad-device="tablet"]):not([data-rooom-test2-ad-device="phone"]) #pageFade>.rooomTest2AdRailPrimary{
  display:block!important;grid-column:1!important;grid-row:1!important;
  align-self:start!important;min-height:0!important;
 }
 html.rooom-ios[data-rooom-test2-ad-preview="home"]:not([data-rooom-test2-ad-device="tablet"]):not([data-rooom-test2-ad-device="phone"]) #pageFade>.rooomTest2AdRailSecondary{display:none!important}
}


/* TEST2: the single desktop ad belongs on the left; the room stays on the
   right. Wide desktop keeps its existing centered two-rail arrangement. */
@media(min-width:700px) and (max-width:1079px){
 html[data-rooom-test2-ad-device="desktop"][data-rooom-test2-ad-preview="room"] .app{
  grid-template-columns:318px minmax(0,1fr)!important;
 }
 html[data-rooom-test2-ad-device="desktop"][data-rooom-test2-ad-preview="room"] .app>.sidebar,
 html[data-rooom-test2-ad-device="desktop"][data-rooom-test2-ad-preview="room"] .app>.chat{
  grid-column:2!important;
 }
 html[data-rooom-test2-ad-device="desktop"][data-rooom-test2-ad-preview="room"] .app>.rooomTest2AdRailPrimary{
  display:block!important;
  grid-column:1!important;
  grid-row:1/3!important;
 }
 html[data-rooom-test2-ad-device="desktop"][data-rooom-test2-ad-preview="home"] #pageFade{
  grid-template-columns:318px minmax(0,1fr)!important;
 }
 html[data-rooom-test2-ad-device="desktop"][data-rooom-test2-ad-preview="home"] #pageFade>.wrap{
  grid-column:2!important;
  grid-row:1!important;
 }
 html[data-rooom-test2-ad-device="desktop"][data-rooom-test2-ad-preview="home"] #pageFade>.rooomTest2AdRailPrimary{
  display:block!important;
  grid-column:1!important;
  grid-row:1!important;
 }
 html[data-rooom-test2-ad-device="desktop"][data-rooom-test2-ad-preview="home"] .rooomFloatingActionDock{
  left:calc(var(--ad-page-left) + 342px)!important;
  right:auto!important;
 }
 html[data-rooom-test2-ad-device="desktop"][data-rooom-test2-ad-preview="home"].rooom-create-dock-right .rooomFloatingActionDock{
  left:auto!important;
  right:calc(100vw - var(--ad-page-left) - var(--ad-page-width) + 8px)!important;
 }
}

/* TEST2 TOP room collections only: size by the actual content width, not
   window width or device class. Never show 3 columns; 680px => 2 cards.
   Containment is on the section body, not the outer .wrap, so overlays,
   settings, and the floating dock retain their existing positioning. */
html[data-rooom-test2-ad-preview="home"] #pageFade .roomSectionBody{
 container: rooom-test2-room-collection / inline-size;
}
html[data-rooom-test2-ad-preview="home"] #pageFade .roomSectionBody :is(#roomList,#userRoomList,#prepOpenCloneList,#archiveRoomList) > :is(.grid,.list),
html[data-rooom-test2-ad-preview="home"] #pageFade .roomSectionBody #prepOpenCloneList{
 display:grid!important;
 grid-template-columns:minmax(0,1fr)!important;
 min-width:0!important;
}
@container rooom-test2-room-collection (min-width:600px){
 html[data-rooom-test2-ad-preview="home"] #pageFade .roomSectionBody :is(#roomList,#userRoomList,#prepOpenCloneList,#archiveRoomList) > :is(.grid,.list),
 html[data-rooom-test2-ad-preview="home"] #pageFade .roomSectionBody #prepOpenCloneList{
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
 }
}


/* Production only. TEST2 remains non-interactive and network-free.
   Only the actual creative surface accepts clicks; the rail spacing does not. */
html[data-rooom-imobile-live="1"] .rooomTest2AdRail,
html[data-rooom-imobile-live="1"] .rooomTest2AdMobile {
  pointer-events:none!important;
}
html[data-rooom-imobile-live="1"] .rooomTest2AdRail {
  overflow:visible!important;
}
html[data-rooom-imobile-live="1"] .rooomTest2AdRailHead,
html[data-rooom-imobile-live="1"] .rooomTest2AdRailNote {
  display:none!important;
}
html[data-rooom-imobile-live="1"] .rooomTest2AdRailFrame {
  box-sizing:border-box!important;
  width:min(300px,100%)!important;
  min-height:250px!important;
  aspect-ratio:auto!important;
  padding:0!important;
  margin:0 auto!important;
  border:0!important;
  border-radius:0!important;
  background:transparent!important;
  display:block!important;
  pointer-events:auto!important;
  overflow:hidden!important;
}
html[data-rooom-imobile-live="1"] .rooomTest2AdMobileFrame {
  box-sizing:border-box!important;
  width:min(320px,100%)!important;
  height:50px!important;
  min-height:50px!important;
  padding:0!important;
  border:0!important;
  border-radius:0!important;
  background:transparent!important;
  display:block!important;
  pointer-events:auto!important;
  overflow:hidden!important;
}


/* TOP browser: the current one-sided rollout uses two 300x250 creatives
   on the left; the dormant right rail and its existing tag are preserved.
   Room layout, tablet/phone placement and native apps are unchanged. */
html[data-rooom-test2-ad-device="desktop"][data-rooom-test2-ad-preview="home"] #pageFade>.rooomTest2AdRailPrimary{
  box-sizing:border-box!important;
  border:0!important;
  border-radius:0!important;
  background:transparent!important;
  box-shadow:none!important;
  padding:0!important;
  min-height:0!important;
  overflow:visible!important;
}
html[data-rooom-test2-ad-device="desktop"][data-rooom-test2-ad-preview="home"] #pageFade>.rooomTest2AdRailPrimary>.rooomTest2AdRailHead,
html[data-rooom-test2-ad-device="desktop"][data-rooom-test2-ad-preview="home"] #pageFade>.rooomTest2AdRailPrimary>.rooomTest2AdRailNote{
  display:none!important;
}
html[data-rooom-test2-ad-device="desktop"][data-rooom-test2-ad-preview="home"] #pageFade>.rooomTest2AdRailPrimary>.rooomTest2AdRailFrame,
html[data-rooom-test2-ad-device="desktop"][data-rooom-test2-ad-preview="home"] #pageFade>.rooomTest2AdRailPrimary .rooomTest2AdNinjaFrame{
  box-sizing:border-box!important;
  display:block!important;
  width:300px!important;
  max-width:100%!important;
  height:250px!important;
  min-height:250px!important;
  aspect-ratio:auto!important;
  margin:0!important;
  padding:0!important;
  border:0!important;
  border-radius:0!important;
  background:transparent!important;
  overflow:hidden!important;
}
/* TEST2 stays ad-network-free, but no longer shows the old dashed mock-ups. */
html[data-rooom-test2-ad-device="desktop"][data-rooom-test2-ad-preview="home"]:not([data-rooom-imobile-live="1"]) #pageFade>.rooomTest2AdRailPrimary>.rooomTest2AdRailFrame{
  color:transparent!important;
  font-size:0!important;
}
html[data-rooom-test2-ad-preview="home"] .rooomTest2AdNinja{
  display:none!important;
  margin-top:16px!important;
  padding:0!important;
  pointer-events:none!important;
}
html[data-rooom-imobile-live="1"][data-rooom-test2-ad-preview="home"] .rooomTest2AdNinjaFrame{
  pointer-events:auto!important;
}
@media(min-width:700px){
  html[data-rooom-test2-ad-device="desktop"][data-rooom-test2-ad-preview="home"] .rooomTest2AdNinja{
    display:block!important;
  }
  /* Default to one-sided layout from FIRST PAINT: the protected HTML
     preflight sets preview/device before the deferred JS adds the ON/OFF. */
  html[data-rooom-test2-ad-device="desktop"][data-rooom-test2-ad-preview="home"]:not([data-rooom-home-right-ad="on"]){
    --ad-page-width:min(1348px,calc(100vw - 24px));
    --ad-page-left:max(12px,calc((100vw - 1348px)/2));
    --ad-room-width:calc(var(--ad-page-width) - 334px);
  }
  html[data-rooom-test2-ad-device="desktop"][data-rooom-test2-ad-preview="home"]:not([data-rooom-home-right-ad="on"]) #pageFade{
    display:grid!important;
    width:var(--ad-page-width)!important;
    grid-template-columns:318px minmax(0,1fr)!important;
    column-gap:16px!important;
    margin-left:var(--ad-page-left)!important;
    margin-right:0!important;
  }
  html[data-rooom-test2-ad-device="desktop"][data-rooom-test2-ad-preview="home"]:not([data-rooom-home-right-ad="on"]) #pageFade>.wrap{
    grid-column:2!important;
    grid-row:1!important;
    width:100%!important;
    min-width:0!important;
  }
  html[data-rooom-test2-ad-device="desktop"][data-rooom-test2-ad-preview="home"]:not([data-rooom-home-right-ad="on"]) #pageFade>.rooomTest2AdRailPrimary{
    display:block!important;
    grid-column:1!important;
    grid-row:1!important;
  }
  html[data-rooom-test2-ad-device="desktop"][data-rooom-test2-ad-preview="home"]:not([data-rooom-home-right-ad="on"]) #pageFade>.rooomTest2AdRailSecondary{
    display:none!important;
  }
  html[data-rooom-test2-ad-device="desktop"][data-rooom-test2-ad-preview="home"]:not([data-rooom-home-right-ad="on"]) .rooomFloatingActionDock{
    left:calc(var(--ad-page-left) + 342px)!important;
    right:auto!important;
  }
  html[data-rooom-test2-ad-device="desktop"][data-rooom-test2-ad-preview="home"]:not([data-rooom-home-right-ad="on"]).rooom-create-dock-right .rooomFloatingActionDock{
    left:auto!important;
    right:calc(100vw - var(--ad-page-left) - var(--ad-page-width) + 8px)!important;
  }
}


/* Browser desktop room follows TOP's one-sided advertising layout.
   Existing tablet/mobile and room keyboard ownership remain unchanged. */
@media (min-width:700px) {
  html[data-rooom-test2-ad-device="desktop"][data-rooom-test2-ad-preview="room"]:not([data-rooom-room-right-ad="on"]) {
    --ad-page-width:min(1348px,calc(100vw - 24px));
    --ad-page-left:max(12px,calc((100vw - 1348px)/2));
    --ad-room-width:calc(var(--ad-page-width) - 334px);
  }
  html[data-rooom-test2-ad-device="desktop"][data-rooom-test2-ad-preview="room"]:not([data-rooom-room-right-ad="on"]) .app{
    grid-template-columns:318px minmax(0,1fr)!important;
    column-gap:16px!important;
  }
  html[data-rooom-test2-ad-device="desktop"][data-rooom-test2-ad-preview="room"]:not(.rooom-room-layout-lock):not([data-rooom-room-right-ad="on"]) .app{
    width:var(--ad-page-width)!important;
    max-width:1348px!important;
    margin-left:var(--ad-page-left)!important;
    margin-right:0!important;
  }
  html[data-rooom-test2-ad-device="desktop"][data-rooom-test2-ad-preview="room"]:not([data-rooom-room-right-ad="on"]) .app>.sidebar,
  html[data-rooom-test2-ad-device="desktop"][data-rooom-test2-ad-preview="room"]:not([data-rooom-room-right-ad="on"]) .app>.chat{
    grid-column:2!important;
  }
  html[data-rooom-test2-ad-device="desktop"][data-rooom-test2-ad-preview="room"]:not([data-rooom-room-right-ad="on"]) .app>.rooomTest2AdRailPrimary{
    display:block!important;
    grid-column:1!important;
    grid-row:1/3!important;
    align-self:start!important;
  }
  html[data-rooom-test2-ad-device="desktop"][data-rooom-test2-ad-preview="room"]:not([data-rooom-room-right-ad="on"]) .app>.rooomTest2AdRailSecondary{
    display:none!important;
  }
  html[data-rooom-test2-ad-device="desktop"][data-rooom-test2-ad-preview="room"] .app>.rooomTest2AdRailPrimary{
    box-sizing:border-box!important;
    border:0!important;
    border-radius:0!important;
    background:transparent!important;
    box-shadow:none!important;
    padding:0!important;
    min-height:0!important;
    overflow:visible!important;
  }
  html[data-rooom-test2-ad-device="desktop"][data-rooom-test2-ad-preview="room"] .app>.rooomTest2AdRailPrimary>.rooomTest2AdRailHead,
  html[data-rooom-test2-ad-device="desktop"][data-rooom-test2-ad-preview="room"] .app>.rooomTest2AdRailPrimary>.rooomTest2AdRailNote{
    display:none!important;
  }
  html[data-rooom-test2-ad-device="desktop"][data-rooom-test2-ad-preview="room"] .app>.rooomTest2AdRailPrimary>.rooomTest2AdRailFrame,
  html[data-rooom-test2-ad-device="desktop"][data-rooom-test2-ad-preview="room"] .app>.rooomTest2AdRailPrimary .rooomTest2AdNinjaFrame{
    box-sizing:border-box!important;
    display:block!important;
    width:300px!important;
    max-width:100%!important;
    height:250px!important;
    min-height:250px!important;
    aspect-ratio:auto!important;
    margin:0!important;
    padding:0!important;
    border:0!important;
    border-radius:0!important;
    background:transparent!important;
    overflow:hidden!important;
  }
  html[data-rooom-test2-ad-device="desktop"][data-rooom-test2-ad-preview="room"]:not([data-rooom-imobile-live="1"]) .app>.rooomTest2AdRailPrimary>.rooomTest2AdRailFrame{
    color:transparent!important;
    font-size:0!important;
  }
  html[data-rooom-test2-ad-device="desktop"][data-rooom-test2-ad-preview="room"] .rooomTest2AdNinja{
    display:block!important;
  }
}
html[data-rooom-imobile-live="1"][data-rooom-test2-ad-preview="room"] .rooomTest2AdNinjaFrame{
  pointer-events:auto!important;
}


/* All 320x50 bottom placements: remove the test preview's visual scaffold.
   Keep the allocated 50px so TOP controls and room composer cannot collide. */
html[data-rooom-test2-ad-preview] .rooomTest2AdMobileFrame{
  box-sizing:border-box!important;
  width:min(320px,100%)!important;
  height:50px!important;
  min-height:50px!important;
  background:transparent!important;
  border:0!important;
  border-radius:0!important;
  box-shadow:none!important;
  color:transparent!important;
  font-size:0!important;
  padding:0!important;
}
html[data-rooom-test2-ad-preview]:not([data-rooom-imobile-live="1"]) .rooomTest2AdMobileFrame{
  pointer-events:none!important;
}


/* 2026-11-01 three-column trial: the 600px two-column rule above is the
   immutable fallback. The extra column applies only while right ads are OFF.
   Query the actual section width, never the desktop viewport or device type.
   Restore right ads => original maximum-two-column proportions automatically.
   Exact baseline and rollback: .architecture/AD_LAYOUT_BASELINE_20261101.md */
@container rooom-test2-room-collection (min-width:900px){
  html[data-rooom-test2-ad-preview="home"]:not([data-rooom-home-right-ad="on"]) #pageFade .roomSectionBody :is(#roomList,#userRoomList,#prepOpenCloneList,#archiveRoomList) > .grid,
  html[data-rooom-test2-ad-preview="home"][data-rooom-top-view="card"]:not([data-rooom-home-right-ad="on"]) #pageFade .roomSectionBody #prepOpenCloneList{
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
  }
}
@container rooom-test2-room-collection (min-width:960px){
  html[data-rooom-test2-ad-preview="home"]:not([data-rooom-home-right-ad="on"]) #pageFade .roomSectionBody :is(#roomList,#userRoomList,#prepOpenCloneList,#archiveRoomList) > .list,
  html[data-rooom-test2-ad-preview="home"][data-rooom-top-view="list"]:not([data-rooom-home-right-ad="on"]) #pageFade .roomSectionBody #prepOpenCloneList{
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
  }
}

/* Real ad slots on all devices: no preview/dummy painting. The existing
   300x250 / 320x50 allocation, tablet breakpoints, and ad activation
   guards remain authoritative. Keep CSS-only first paint blank on TEST2. */
html[data-rooom-test2-ad-preview] :is(.rooomTest2AdRail,.rooomTest2AdMobile,.rooomTest2AdRailFrame,.rooomTest2AdMobileFrame,.rooomTest2AdNinja,.rooomTest2AdNinjaFrame){
  border:0!important;
  border-radius:0!important;
  background:transparent!important;
  box-shadow:none!important;
  color:transparent!important;
  text-shadow:none!important;
}
html[data-rooom-test2-ad-preview] .rooomTest2AdRail{
  padding:0!important;
  min-height:0!important;
  overflow:visible!important;
}
html[data-rooom-test2-ad-preview] :is(.rooomTest2AdRailFrame,.rooomTest2AdNinjaFrame){
  width:300px!important;
  max-width:100%!important;
  height:250px!important;
  min-height:250px!important;
  aspect-ratio:auto!important;
  margin:0!important;
  padding:0!important;
  font-size:0!important;
  overflow:hidden!important;
}
html[data-rooom-test2-ad-preview] .rooomTest2AdMobileFrame{
  width:min(320px,100%)!important;
  height:50px!important;
  min-height:50px!important;
  padding:0!important;
  font-size:0!important;
}
html[data-rooom-test2-ad-preview]:not([data-rooom-imobile-live="1"]) :is(.rooomTest2AdRailFrame,.rooomTest2AdMobileFrame,.rooomTest2AdNinjaFrame){
  pointer-events:none!important;
}
html[data-rooom-imobile-live="1"] :is(.rooomTest2AdRailFrame,.rooomTest2AdMobileFrame,.rooomTest2AdNinjaFrame){
  pointer-events:auto!important;
}


/* Production ad scope hardening: the secondary Ninja creative on the
   ROOM left rail is desktop-browser-only. On iPad/Android tablet the single
   left i-mobile creative remains; on phones the bottom Ninja is separate. */
html[data-rooom-test2-ad-preview="room"]:not([data-rooom-test2-ad-device="desktop"]) .rooomTest2AdNinja,
html.ipad-device.ios-device[data-rooom-test2-ad-preview="room"] .rooomTest2AdNinja{
  display:none!important;
}

/* iPad Safari landscape: reveal the existing Ninja 300x250 below i-mobile; other devices unchanged. */
@media (min-width:700px) and (orientation:landscape) {
  html.rooom-ios[data-rooom-test2-ad-device="tablet"][data-rooom-imobile-live="1"][data-rooom-test2-ad-preview] .rooomTest2AdRailPrimary > .rooomTest2AdNinja,
  html.ipad-device.ios-device[data-rooom-test2-ad-device="tablet"][data-rooom-imobile-live="1"][data-rooom-test2-ad-preview] .rooomTest2AdRailPrimary > .rooomTest2AdNinja {
    display:block!important;
  }
}

/* iPad BROWSER portrait-only 728x90 spot 1951545 (WebView/SDK excluded). */
/* The existing 320x50 is the fallback for narrow split-view and other devices.
   Reserve an extra 40px only when the 728px creative physically fits. */
@media (min-width:728px) and (orientation:portrait) {
  html[data-rooom-ipad-browser-banner="728x90"][data-rooom-test2-ad-device="tablet"][data-rooom-test2-ad-preview="room"] .app {
    grid-template-rows:auto minmax(0,1fr) calc(90px + var(--ad-bottom-safe))!important;
  }
  html[data-rooom-ipad-browser-banner="728x90"][data-rooom-test2-ad-device="tablet"][data-rooom-test2-ad-preview="room"] .app > .rooomTest2AdMobile,
  html[data-rooom-ipad-browser-banner="728x90"][data-rooom-test2-ad-device="tablet"][data-rooom-test2-ad-preview="home"] body > .rooomTest2AdMobile {
    min-height:90px!important;
  }
  html[data-rooom-ipad-browser-banner="728x90"][data-rooom-test2-ad-device="tablet"][data-rooom-test2-ad-preview] .rooomTest2AdMobileFrame {
    width:728px!important;
    max-width:100%!important;
    height:90px!important;
    min-height:90px!important;
    overflow:hidden!important;
  }
  html[data-rooom-ipad-browser-banner="728x90"][data-rooom-test2-ad-device="tablet"][data-rooom-test2-ad-preview="home"] .rooomFloatingActionDock {
    bottom:calc(var(--rooom-safe-bottom,0px) + 100px)!important;
  }
  html[data-rooom-ipad-browser-banner="728x90"][data-rooom-test2-ad-device="tablet"][data-rooom-test2-ad-preview="home"].rooom-create-dock-right .rooomFloatingActionDock {
    bottom:calc(var(--rooom-safe-bottom,0px) + 100px)!important;
  }
  html[data-rooom-ipad-browser-banner="728x90"][data-rooom-test2-ad-device="tablet"][data-rooom-test2-ad-preview="home"] .wrap {
    padding-bottom:calc(200px + var(--rooom-safe-bottom,0px))!important;
  }
}

/* Android TWA phone IME ad positioning: 2026-11-07
   The keyboard shrinks the ROOM shell, but only the composer follows it.
   Keep the already-mounted 320x50 ad in the zero-height last grid row.
   Clip at that row: flex centering otherwise exposes its upper 25px.
   Do not depend on viewport orientation, which can change when IME opens.
   Never remount the ad; normal visibility returns when the keyboard closes. */
  html.rooom-room-layout-lock.rooom-keyboard-open[data-rooom-imobile-live="1"][data-rooom-android-twa-ad-test="on"][data-rooom-test2-ad-device="phone"][data-rooom-test2-ad-preview="room"] .app {
    grid-template-rows:auto minmax(0,1fr) 0px!important;
  }
  html.rooom-room-layout-lock.rooom-keyboard-open[data-rooom-imobile-live="1"][data-rooom-android-twa-ad-test="on"][data-rooom-test2-ad-device="phone"][data-rooom-test2-ad-preview="room"] .app > .rooomTest2AdMobile {
    overflow:hidden!important;
    visibility:hidden!important;
  }

/* Entrance surfaces fill the viewport; this rule deliberately outranks the
   existing portrait banner selectors without changing their ready-state size. */
html:root:is(.rooom-first-onboarding-active,[data-rooom-ad-presentation="intro"]):not([data-rooom-ad-presentation="preparing"]):not([data-rooom-ad-presentation="ready"]) :is(#pageFade,body) :is(.rooomTest2AdRail,.rooomTest2AdMobile,.rooomLandscapeSlots){display:none!important}
/* The same Web barrier covers normal startup before the first TOP paint. */
html:root:not([data-rooom-ad-presentation="ready"]):not([data-rooom-ad-presentation="unavailable"]):not([data-rooom-ad-presentation="unconfirmed"]) #pageFade{visibility:hidden!important}

/* Direct ROOM entry shares the Web-owned first-paint barrier. */
html:root[data-rooom-ad-presentation]:not([data-rooom-ad-presentation="ready"]):not([data-rooom-ad-presentation="unavailable"]):not([data-rooom-ad-presentation="unconfirmed"]) body > .app{visibility:hidden!important}
