/* Social pages share the screen rail; each route owns its content stage. */
body.communities-route-page.rx-landscape-shell .community-layout {
  position: absolute;
  inset: var(--rx-visual-top, 0px) 0 var(--rx-keyboard-bottom, 0px) var(--rx-landscape-rail);
  width: auto;
  height: auto;
  min-height: 0;
  padding: 0 max(8px, var(--rx-safe-right)) max(8px, var(--rx-safe-bottom)) 8px;
}
body.communities-route-page.rx-landscape-shell .community-main {
  height: 100%;
  min-height: 0;
  margin: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  overflow-anchor: none;
}
.rx-landscape-community-toolbar {
  position: sticky;
  top: 0;
  z-index: var(--rx-layer-sticky);
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(0, 1.5fr);
  align-items: center;
  gap: 8px;
  padding-block: 4px;
  background: var(--rx-color-page);
}
body.rx-landscape-shell .community-topbar-search { width: 100%; max-width: none; margin: 0; min-height: 44px; height: 44px; }
body.rx-landscape-shell .community-mobile-tabs { width: 100%; margin: 0; padding: 0; gap: 0; }
body.rx-landscape-shell .community-mobile-tab.btn,
body.rx-landscape-shell .community-mobile-feed-home { min-height: 44px; flex-direction: row; gap: 4px; }
body.rx-landscape-shell .community-mobile-tab svg { display: none; }
body.rx-landscape-shell .community-app-shell { width: 100%; }
body.rx-landscape-shell .community-chat-panel {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  gap: 8px;
  padding: 8px;
  height: calc(100dvh - var(--rx-visual-top, 0px) - var(--rx-keyboard-bottom, 0px) - 60px - max(0px, var(--rx-safe-bottom) - 8px));
  min-height: 0;
}
.rx-landscape-chat-tools { min-height: 0; min-width: 0; overflow: auto; }
body.rx-landscape-shell .community-chat-panel :is(#globalChatArea, #globalChatLocked) { grid-column: 2; grid-row: 1; min-width: 0; }
body.rx-landscape-shell .community-chat-panel #globalChatMessages.global-chat-messages { min-height: 0; margin: 0; width: 100%; }
body.rx-landscape-shell .community-chat-panel #globalChatArea > .muted.small { display: none; }
body.rx-landscape-shell .community-chat-panel .community-chat-heading { display: none; }
/* While writing, the conversation keeps the remaining height. Blurring the
   composer restores search and section navigation without discarding a draft. */
html[data-rx-keyboard-open] body.rx-landscape-shell:has(#globalChatInput:focus) .rx-landscape-community-toolbar { display: none; }
html[data-rx-keyboard-open] body.rx-landscape-shell:has(#globalChatInput:focus) .community-chat-panel {
  height: calc(100dvh - var(--rx-visual-top, 0px) - var(--rx-keyboard-bottom, 0px) - max(8px, var(--rx-safe-bottom)));
}
body.profile-page.rx-landscape-shell .profile-page-main {
  position: absolute;
  inset: 0 0 auto var(--rx-landscape-rail);
  width: auto;
  max-width: none;
  height: 100dvh;
  min-height: 0;
  margin: 0;
  padding: 8px max(8px, var(--rx-safe-right)) max(8px, var(--rx-safe-bottom)) 8px;
}
body.profile-page.rx-landscape-shell .profile-shell:not(.hidden) {
  display: grid;
  grid-template-columns: minmax(200px, 32%) minmax(0, 1fr);
  height: 100%;
  min-height: 0;
  gap: 12px;
}
.rx-landscape-profile-identity, .rx-landscape-profile-content { min-width: 0; min-height: 0; overflow: auto; overflow-anchor: none; }
body.profile-page.rx-landscape-shell .profile-v2-hero { display: flex; flex-direction: column; align-items: stretch; min-height: 0; padding: 12px; gap: 8px; }
body.profile-page.rx-landscape-shell .profile-v2-identity { flex-direction: column; align-items: stretch; gap: 8px; }
body.profile-page.rx-landscape-shell .profile-avatar-frame { width: 48px; height: 48px; }
body.profile-page.rx-landscape-shell .profile-v2-title-row { padding-right: 0; }
body.profile-page.rx-landscape-shell .profile-name { font-size: var(--rx-font-size-body); overflow-wrap: anywhere; }
body.profile-page.rx-landscape-shell .profile-hero-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
body.profile-page.rx-landscape-shell .profile-hero-stat { min-width: 0; padding: 4px; overflow-wrap: anywhere; }
body.profile-page.rx-landscape-shell .profile-v2-summary { margin-top: 8px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
body.profile-page.rx-landscape-shell .profile-v2-summary-item { padding: 8px; }
body.profile-page.rx-landscape-shell .profile-v2-tabs { position: sticky; top: 0; z-index: var(--rx-layer-sticky); margin: 0 0 8px; padding: 0; gap: 0; background: var(--rx-color-page); }
body.profile-page.rx-landscape-shell .profile-v2-tab { flex: 1; min-width: 0; }
body.profile-page.rx-landscape-shell :is(.profile-ratings-list, .profile-mini-stats, .profile-community-post-list, .profile-about-details-grid) { grid-template-columns: minmax(0, 1fr); }

/* Feed and joined communities share the desktop hierarchy in two columns.
   Chat occupies its own workspace when selected. */
body.communities-route-page.rx-landscape-shell .community-app-shell { display:grid; grid-template-columns:170px minmax(0,1fr); gap:8px; height:100%; min-height:0; overflow:hidden; }
body.communities-route-page.rx-landscape-shell :is(.community-left-column,.community-social-column) { min-width:0; min-height:0; height:100%; overflow:auto; }
body.communities-route-page.rx-landscape-shell .community-left-column { display:flex; flex-direction:column; }
body.communities-route-page.rx-landscape-shell .community-social-column { display:block; }
body.communities-route-page.rx-landscape-shell .community-subscription-rail { max-height:none; padding:8px; }
body.communities-route-page.rx-landscape-shell .community-rail-list { max-height:none; }
body.communities-route-page.rx-landscape-shell:not([data-community-mobile-tab="chat"]) [data-community-tab-panel="chat"] { display:none; }
body.communities-route-page.rx-landscape-shell[data-community-mobile-tab="chat"] .community-app-shell { grid-template-columns:minmax(0,1fr); }
body.communities-route-page.rx-landscape-shell[data-community-mobile-tab="chat"] :is(.community-left-column,.community-social-column) { display:none; }
