/* RedFeed — Feed sempre atrás, abas como camadas (estilo Instagram) */



body.rf-stack-open {

  overscroll-behavior: none;

}



body.rf-stack-mode #rf-page-root:not([data-rf-stack-proxy="1"]) {

  visibility: visible !important;

  opacity: 1 !important;

}



body.rf-stack-mode.rf-stack-open #rf-page-root:not([data-rf-stack-proxy="1"]) {

  pointer-events: none !important;

}



body.rf-stack-open.rf-stack-messages-open #rf-page-root:not([data-rf-stack-proxy="1"]),
body.rf-stack-open.rf-stack-messages-open #rf-page-root[data-rf-hidden-under-messages="1"] {

  visibility: hidden !important;

  opacity: 0 !important;

  pointer-events: none !important;

}



body.rf-stack-mode:not(.rf-stack-open) #rf-page-root:not([data-rf-stack-proxy="1"]) {

  pointer-events: auto !important;

}



#rfStackRoot {

  position: fixed;

  inset: 0;

  z-index: 2147482700;

  pointer-events: none;

}



body.rf-stack-mode:not(.rf-stack-open) #rfStackRoot {

  visibility: hidden !important;

  pointer-events: none !important;

  z-index: -1 !important;

}



body.rf-stack-open #rfStackRoot {

  visibility: visible !important;

  pointer-events: none;

  z-index: 2147482700;

}



/* Desktop: camada só na area central — rail lateral permanece visivel (IG) */

@media (min-width: 1100px) {

  body.rf-desktop-ui.rf-stack-mode .rf-shell {

    position: relative;

  }



  body.rf-desktop-ui.rf-stack-mode #rfStackRoot {

    position: fixed;

    top: 0;

    right: 0;

    bottom: 0;

    left: var(--rf-rail-w, 72px);

    z-index: 60;

  }



  body.rf-desktop-ui.rf-redfeed-home.rf-stack-open #rf-page-root:not([data-rf-stack-proxy="1"]) {

    visibility: hidden !important;

    opacity: 0 !important;

    pointer-events: none !important;

  }



  body.rf-desktop-ui.rf-stack-open #rfDesktopAside {

    visibility: hidden;

    pointer-events: none;

  }



  body.rf-desktop-ui.rf-stack-open .rf-desktop-rail {

    display: flex !important;

    visibility: visible !important;

    pointer-events: auto !important;

  }



  body.rf-desktop-ui .rf-stack-layer {

    transform: none;

    transition: opacity 0.18s ease;

    opacity: 0;

  }



  body.rf-desktop-ui .rf-stack-layer.on {

    transform: none;

    opacity: 1;

  }



  body.rf-desktop-ui .rf-stack-layer.is-under {

    transform: none;

    opacity: 0;

    display: none;

  }



  body.rf-desktop-ui.rf-stack-open .rf-stack-layer.on .rf-stack-tab-body {

    display: flex;

    flex-direction: column;

    align-items: center;

  }



  body.rf-desktop-ui.rf-stack-open .rf-stack-layer.on .rf-stack-page-root {

    width: min(620px, 100%) !important;

    max-width: 620px !important;

    flex: 1 1 auto;

    min-height: 0;

  }



  body.rf-desktop-ui.rf-stack-open .rf-stack-layer.on[data-rf-stack-nav="messages"] .rf-stack-tab-body,

  body.rf-desktop-ui.rf-stack-open .rf-stack-layer.on[data-rf-stack-nav="lives"] .rf-stack-tab-body,

  body.rf-desktop-ui.rf-stack-open .rf-stack-layer.on[data-rf-stack-nav="explorar"] .rf-stack-tab-body,

  body.rf-desktop-ui.rf-stack-open .rf-stack-layer.on[data-rf-stack-nav="profile"] .rf-stack-tab-body {

    align-items: stretch;

  }



  body.rf-desktop-ui.rf-stack-open .rf-stack-layer.on[data-rf-stack-nav="messages"] .rf-stack-page-root,

  body.rf-desktop-ui.rf-stack-open .rf-stack-layer.on[data-rf-stack-nav="lives"] .rf-stack-page-root,

  body.rf-desktop-ui.rf-stack-open .rf-stack-layer.on[data-rf-stack-nav="explorar"] .rf-stack-page-root {

    width: 100% !important;

    max-width: none !important;

  }



  /* Perfil desktop — coluna ~1010px (grade dos posts estoura via CSS no perfil) */

  body.rf-desktop-ui.rf-stack-open .rf-stack-layer.on[data-rf-stack-nav="profile"] .rf-stack-page-root {

    width: 100% !important;

    max-width: min(1010px, calc(100vw - var(--rf-rail-w, 72px) - 32px)) !important;

    margin-left: auto !important;

    margin-right: auto !important;

  }

}



/* Perfil na stack — scroll interno + layout correto */

body.rf-stack-open .rf-stack-layer.on[data-rf-stack-nav="profile"] {

  display: flex !important;

  flex-direction: column !important;

  min-height: 0 !important;

  height: 100% !important;

}



body.rf-stack-open .rf-stack-layer.on[data-rf-stack-nav="profile"] .rf-stack-layer-inner {

  flex: 1 1 auto !important;

  min-height: 0 !important;

  display: flex !important;

  flex-direction: column !important;

}



body.rf-stack-open .rf-stack-layer.on[data-rf-stack-nav="profile"] .rf-stack-tab-body {

  flex: 1 1 auto !important;

  min-height: 0 !important;

  overflow-y: auto !important;

  overflow-x: hidden !important;

  overscroll-behavior: contain;

  -webkit-overflow-scrolling: touch;

}



body.rf-stack-open .rf-stack-layer.on[data-rf-stack-nav="profile"] .rf-stack-page-root,

body.rf-stack-open .rf-stack-layer.on[data-rf-stack-nav="profile"] main.rf-profile,

body.rf-stack-open .rf-stack-layer.on[data-rf-stack-nav="profile"] .rf-stack-layer-inner .rf-stack-page-root,

body.rf-stack-open .rf-stack-layer.on[data-rf-stack-nav="profile"] .rf-stack-layer-inner main.rf-profile {

  flex: none !important;

  min-height: auto !important;

  height: auto !important;

  overflow: visible !important;

}



body.rf-desktop-ui.rf-stack-open .rf-stack-layer.on[data-rf-stack-nav="profile"] .rf-stack-tab-body {

  display: block !important;

  align-items: stretch !important;

  width: 100% !important;

  touch-action: pan-y;

  overflow-x: visible !important;

}



body.rf-desktop-ui.rf-stack-open .rf-stack-layer.on[data-rf-stack-nav="profile"] .rf-stack-page-root {

  flex: none !important;

  min-height: auto !important;

  height: auto !important;

  width: 100% !important;

  max-width: min(1010px, calc(100vw - var(--rf-rail-w, 72px) - 32px)) !important;

  margin-left: auto !important;

  margin-right: auto !important;

}



body.rf-desktop-ui.rf-stack-open .rf-stack-layer.on[data-rf-stack-nav="explorar"] .rf-stack-tab-body {

  display: block !important;

  width: 100% !important;

  align-items: stretch !important;

}



body.rf-desktop-ui.rf-stack-open .rf-stack-layer.on[data-rf-stack-nav="explorar"] .rf-stack-page-root,

body.rf-stack-open .rf-stack-layer.on[data-rf-stack-nav="explorar"] .rf-stack-layer-inner .rf-stack-page-root,

body.rf-stack-open .rf-stack-layer.on[data-rf-stack-nav="explorar"] main.rf-explore {

  flex: none !important;

  min-height: auto !important;

  height: auto !important;

  width: 100% !important;

  max-width: none !important;

}



@media (max-width: 1099px) {

  body.rf-stack-open.rf-profile-page main.rf-profile.rf-profile-layout-reels {

    width: 100% !important;

    max-width: none !important;

    margin: 0 !important;

    padding: 0 0 calc(72px + env(safe-area-inset-bottom, 0px)) !important;

    background: #050508 !important;

  }



  body.rf-stack-open.rf-profile-page main.rf-profile.rf-profile-layout-reels .rf-container {

    width: 100% !important;

    max-width: none !important;

    margin: 0 !important;

    padding: 0 !important;

    box-sizing: border-box;

  }



  body.rf-stack-open.rf-profile-page main.rf-profile.rf-profile-layout-reels .rf-profile-reels-hero {

    width: 100% !important;

    max-width: none !important;

    margin: 0 !important;

    border-radius: 0 !important;

  }

}



body.rf-desktop-ui.rf-stack-open .rf-stack-layer.on[data-rf-stack-nav="profile"] .rf-stack-tab-body {

  scrollbar-width: none;

  -ms-overflow-style: none;

}



body.rf-desktop-ui.rf-stack-open .rf-stack-layer.on[data-rf-stack-nav="profile"] .rf-stack-tab-body::-webkit-scrollbar {

  display: none;

  width: 0;

  height: 0;

}



/* Reels visivel só no gesto Kwai (iframe dentro do viewer) — nunca por cima da stack de perfil */
body.rf-stack-open.rf-feed-reels-open #rfFeedReelsViewer.on.rf-kwai-profile-open,
body.rf-stack-open.rf-feed-reels-open #rfFeedReelsViewer.on.rf-kwai-dragging-profile {
  pointer-events: auto !important;
  display: block !important;
}

body.rf-stack-open:has(.rf-stack-layer.on[data-rf-stack-nav="profile"]) #rfFeedReelsViewer {
  display: none !important;
  pointer-events: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
}



@media (max-width: 860px) {

  body.rf-stack-open:not(.rf-dm-stack-chat-step) #rfStackRoot {

    bottom: calc(56px + env(safe-area-inset-bottom, 0px));

  }

  html[data-rf-native-app="1"] body.rf-stack-mode .rf-bottom-nav,
  html[data-rf-native-app="1"] body.rf-stack-open .rf-bottom-nav {
    position: fixed !important;
    z-index: 2147483750 !important;
    pointer-events: auto !important;
  }

}



.rf-stack-layer {

  position: absolute;

  inset: 0;

  display: none;

  flex-direction: column;

  pointer-events: none;

  background: #07070b;

  overflow: hidden;

  transform: translateX(100%);

  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);

  will-change: transform;

}



html[data-rf-theme="light"] .rf-stack-layer {

  background: #fff;

}



.rf-stack-layer.on {

  display: flex;

  pointer-events: auto;

  transform: translateX(0);

}



.rf-stack-layer.is-under {

  display: flex;

  pointer-events: none;

  transform: translateX(-18%);

  opacity: 0.55;

  z-index: 1;

}



.rf-stack-layer.on {

  z-index: 2;

}



.rf-stack-layer[data-rf-stack-nav="profile"]:not(.on):not(.is-under):not(.rf-stack-layer-pending):not(.rf-stack-layer-exit) {

  display: none !important;

  pointer-events: none !important;

  visibility: hidden !important;

}



@media (max-width: 860px) {

  .rf-stack-layer.rf-stack-layer-pending {

    display: flex !important;

    pointer-events: none;

    transform: translateX(100%);

  }



  .rf-stack-layer.rf-stack-layer-exit {

    display: flex !important;

    pointer-events: none !important;

    transform: translateX(100%) !important;

    z-index: 3;

  }

}



.rf-stack-layer-inner {

  flex: 1;

  min-height: 0;

  width: 100%;

  overflow: hidden;

}



.rf-stack-layer-inner .rf-stack-page-root,

.rf-stack-layer-inner [data-rf-stack-proxy="1"],
.rf-stack-layer-inner .rf-stack-page-root {

  width: 100% !important;

  max-width: 100% !important;

  margin: 0 !important;

  min-height: 100%;

  box-sizing: border-box;

}



.rf-stack-layer-inner .rf-explore,

.rf-stack-layer-inner .rf-dm-wrap-page,

.rf-stack-layer-inner main.rf-profile,

.rf-stack-layer-inner .rf-lives-hub {

  width: 100% !important;

  max-width: 100% !important;

  margin: 0 !important;

  min-height: 100%;

  box-sizing: border-box;

}



.rf-stack-layer-head {

  display: none !important;

}



/* Cabecalho unico estilo Notificacoes (voltar + titulo) */

.rf-stack-layer.on .rf-stack-layer-inner {

  display: flex;

  flex-direction: column;

  min-height: 0;

}



/* Cabecalho stack antigo (titulo + faixa) — desativado */

body.rf-stack-open .rf-stack-tab-head {

  display: none !important;

}



.rf-stack-layer.on .rf-stack-layer-inner {

  position: relative;

}



/* << flutuante — Mensagens / Lives (Explorar e Perfil usam o botao nativo da pagina) */

.rf-stack-float-back {

  position: absolute;

  z-index: 80;

  top: max(10px, env(safe-area-inset-top));

  left: 12px;

  width: 42px;

  height: 42px;

  border-radius: 999px;

  border: 1px solid rgba(255, 255, 255, 0.12);

  background: rgba(7, 7, 11, 0.88);

  backdrop-filter: blur(12px);

  color: #fff;

  display: grid;

  place-items: center;

  font-size: 1rem;

  cursor: pointer;

  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);

  -webkit-tap-highlight-color: transparent;

}



html[data-rf-theme="light"] .rf-stack-float-back {

  background: rgba(255, 255, 255, 0.94);

  border-color: rgba(0, 0, 0, 0.1);

  color: #12121a;

}



.rf-stack-float-back:hover,

.rf-stack-float-back:focus-visible {

  background: rgba(255, 23, 77, 0.22);

  border-color: rgba(255, 23, 77, 0.35);

  color: #fff;

}



.rf-stack-tab-body {

  flex: 1;

  min-height: 0;

  overflow-y: auto;

  overflow-x: hidden;

  overscroll-behavior: contain;

  -webkit-overflow-scrolling: touch;

}



body.rf-stack-open .rf-stack-layer[data-rf-stack-nav="messages"] .rf-stack-tab-body,

body.rf-stack-open .rf-stack-layer[data-rf-stack-nav="lives"] .rf-stack-tab-body {

  padding-top: 0;

}



.rf-stack-layer[data-rf-stack-nested="1"] .rf-stack-layer-head {

  display: flex;

  align-items: center;

  justify-content: space-between;

  gap: 10px;

  flex-shrink: 0;

  padding: max(10px, env(safe-area-inset-top)) 12px 10px;

  border-bottom: 1px solid rgba(255, 255, 255, 0.08);

  background: rgba(11, 10, 16, 0.98);

  backdrop-filter: blur(16px);

  z-index: 2;

}



.rf-stack-layer[data-rf-stack-nested="1"] .rf-stack-back {

  border: 0;

  background: rgba(255, 255, 255, 0.08);

  color: #fff;

  width: 40px;

  height: 40px;

  border-radius: 12px;

  cursor: pointer;

  flex-shrink: 0;

}



.rf-stack-layer[data-rf-stack-nested="1"] .rf-stack-title {

  margin: 0;

  font-size: 1rem;

  font-weight: 800;

  white-space: nowrap;

  overflow: hidden;

  text-overflow: ellipsis;

}



/* Chat overlay — degrau 2 sobre a camada Mensagens */

#rfStackRoot .rf-dm-chat-overlay,

.rf-dm-chat-overlay {

  position: fixed;

  inset: 0;

  z-index: 2147483000;

  display: none;

  flex-direction: column;

  background: #0b0a10;

  transform: translateX(100%);

  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);

  pointer-events: auto;

}



#rfStackRoot .rf-dm-chat-overlay {

  position: absolute;

}



.rf-dm-chat-overlay.on {

  display: flex;

  transform: translateX(0);

}



.rf-dm-chat-overlay-head {

  display: flex;

  align-items: center;

  justify-content: space-between;

  gap: 10px;

  flex-shrink: 0;

  padding: max(10px, env(safe-area-inset-top)) 12px 10px;

  border-bottom: 1px solid rgba(255, 255, 255, 0.08);

  background: rgba(11, 10, 16, 0.98);

  backdrop-filter: blur(16px);

}



.rf-dm-chat-overlay-back {

  border: 0;

  background: rgba(255, 255, 255, 0.08);

  color: #fff;

  width: 40px;

  height: 40px;

  border-radius: 12px;

  cursor: pointer;

  flex-shrink: 0;

  font-size: 1.1rem;

}



.rf-dm-chat-overlay-title {

  margin: 0;

  font-size: 1rem;

  font-weight: 800;

  white-space: nowrap;

  overflow: hidden;

  text-overflow: ellipsis;

}



.rf-dm-chat-overlay-body {

  flex: 1;

  min-height: 0;

  overflow: hidden;

  display: flex;

  flex-direction: column;

}



.rf-dm-chat-overlay-body .rf-dm-chat,

.rf-dm-chat-stack-overlay {

  flex: 1;

  min-height: 0;

  height: 100%;

  display: flex;

  flex-direction: column;

}



.rf-dm-chat-overlay-loading {

  padding: 48px;

  text-align: center;

  opacity: 0.7;

  margin: auto;

}



/* Mobile stack: chat inline — barra unificada (<< nome ⚙️) no lugar de Conversas */

@media (max-width: 860px) {

  body.rf-dm-stack-chat-step.rf-stack-open .rf-stack-layer.on[data-rf-stack-nav="messages"] .rf-stack-tab-head {

    display: none !important;

  }



  body.rf-dm-stack-chat-step .rf-dm-list[data-has-active="1"] {

    display: flex !important;

    flex-shrink: 0;

  }



  body.rf-dm-stack-chat-step .rf-dm-list .rf-dm-items,

  body.rf-dm-stack-chat-step .rf-dm-list .rf-dm-search,

  body.rf-dm-stack-chat-step .rf-dm-list .rf-dm-filters,

  body.rf-dm-stack-chat-step .rf-dm-list .rf-dm-list-empty {

    display: none !important;

  }



  body.rf-dm-stack-chat-step .rf-dm-list-head--chat {

    border-bottom: 1px solid rgba(255, 255, 255, 0.08);

    background: rgba(11, 10, 16, 0.98);

    backdrop-filter: blur(16px);

  }



  body.rf-dm-stack-chat-step .rf-dm-list-head--loading .rf-dm-chat-bar-title::after {

    content: "";

    display: inline-block;

    width: 12px;

    height: 12px;

    margin-left: 8px;

    border: 2px solid rgba(255, 138, 179, 0.35);

    border-top-color: #ff8ab3;

    border-radius: 50%;

    animation: rfDmHeadSpin 0.75s linear infinite;

    vertical-align: -1px;

  }



  @keyframes rfDmHeadSpin {

    to {

      transform: rotate(360deg);

    }

  }



  body.rf-dm-stack-chat-step .rf-dm-list-head-row {

    align-items: center;

    gap: 10px;

  }



  body.rf-dm-stack-chat-step .rf-dm-chat-bar-back {

    border: 0;

    background: transparent;

    color: #fff;

    width: 40px;

    height: 40px;

    border-radius: 12px;

    display: grid;

    place-items: center;

    font-size: 1.15rem;

    cursor: pointer;

    flex-shrink: 0;

    padding: 0;

  }



  body.rf-dm-stack-chat-step .rf-dm-chat-bar-title {

    flex: 1;

    min-width: 0;

    white-space: nowrap;

    overflow: hidden;

    text-overflow: ellipsis;

    font-size: 1rem;

    font-weight: 800;

  }



  body.rf-dm-stack-chat-step .rf-dm-list-head-spacer {

    width: 38px;

    flex-shrink: 0;

  }



  body.rf-dm-stack-chat-step .rf-stack-layer.on[data-rf-stack-nav="messages"] .rf-dm-wrap {

    display: flex !important;

    flex-direction: column !important;

    grid-template-columns: none !important;

    height: 100%;

    min-height: 0;

  }



  body.rf-dm-stack-chat-step .rf-stack-layer.on[data-rf-stack-nav="messages"] .rf-stack-layer-inner {

    visibility: visible !important;

    display: flex !important;

    flex-direction: column !important;

    min-height: 0;

    height: 100%;

  }



  body.rf-dm-stack-chat-step .rf-stack-layer.on[data-rf-stack-nav="messages"] .rf-stack-tab-body {

    display: flex !important;

    flex-direction: column !important;

    flex: 1 1 auto;

    min-height: 0;

    overflow: hidden !important;

  }



  body.rf-dm-stack-chat-step .rf-stack-layer.on[data-rf-stack-nav="messages"] .rf-stack-page-root,

  body.rf-dm-stack-chat-step .rf-stack-layer.on[data-rf-stack-nav="messages"] .rf-dm-wrap-page,

  body.rf-dm-stack-chat-step .rf-stack-layer.on[data-rf-stack-nav="messages"] .rf-dm-page-container {

    flex: 1 1 auto;

    min-height: 0;

    height: 100% !important;

    max-height: 100% !important;

    overflow: hidden !important;

    display: flex !important;

    flex-direction: column !important;

  }



  body.rf-dm-stack-chat-step.rf-dm-list-only .rf-stack-layer.on[data-rf-stack-nav="messages"] .rf-dm-chat,

  body.rf-dm-stack-chat-step .rf-stack-layer.on[data-rf-stack-nav="messages"] .rf-dm-chat {

    display: grid !important;

    grid-template-rows: auto minmax(0, 1fr) auto !important;

    grid-template-columns: minmax(0, 1fr) !important;

    flex: 1 1 auto;

    min-height: 0;

    height: 100% !important;

    max-height: 100% !important;

    overflow: hidden !important;

  }



  body.rf-dm-stack-chat-step .rf-stack-layer.on[data-rf-stack-nav="messages"] .rf-dm-compose-wrap {

    grid-row: 3 !important;

    flex: 0 0 auto !important;

    display: block !important;

    visibility: visible !important;

    min-height: 56px !important;

    position: relative !important;

    padding: 8px 12px max(10px, env(safe-area-inset-bottom)) !important;

    border-top: 1px solid rgba(255, 255, 255, 0.07) !important;

    background: linear-gradient(180deg, rgba(11, 10, 16, 0.72), rgba(11, 10, 16, 0.98) 28%) !important;

  }



  body.rf-dm-stack-chat-step .rf-stack-layer.on[data-rf-stack-nav="messages"] .rf-dm-messages {

    grid-row: 2 !important;

    flex: 1 1 auto !important;

    min-height: 0 !important;

    overflow-y: auto !important;

  }



  body.rf-stack-open.rf-dm-list-only:not(.rf-dm-stack-chat-step) .rf-stack-layer.on[data-rf-stack-nav="messages"] .rf-dm-wrap {

    display: flex !important;

    flex-direction: column !important;

    grid-template-columns: none !important;

    flex: 1 1 auto;

    min-height: 0;

    height: 100% !important;

  }



  body.rf-stack-open.rf-dm-list-only:not(.rf-dm-stack-chat-step) .rf-stack-layer.on[data-rf-stack-nav="messages"] .rf-dm-list,

  body.rf-stack-open.rf-dm-list-only:not(.rf-dm-stack-chat-step) .rf-dm-list[data-has-active="1"] {

    display: flex !important;

    flex: 1 1 auto;

    min-height: 0;

    height: 100% !important;

  }



  body.rf-stack-open.rf-dm-list-only:not(.rf-dm-stack-chat-step) .rf-stack-layer.on[data-rf-stack-nav="messages"] .rf-dm-items {

    flex: 1 1 auto;

    min-height: 0;

    overflow-y: auto !important;

  }



  body.rf-stack-open.rf-stack-messages-open.rf-dm-list-only:not(.rf-dm-stack-chat-step) .rf-bottom-nav {

    display: flex !important;

    visibility: visible !important;

  }



  body.rf-dm-stack-chat-step .rf-dm-chat-loading,

  body.rf-dm-stack-chat-step .rf-dm-chat.rf-dm-chat-is-loading {

    flex: 1 1 auto;

    min-height: 0;

    display: flex;

    flex-direction: column;

    align-items: center;

    justify-content: center;

  }



  .rf-dm-chat-loading {

    padding: 32px 20px;

    text-align: center;

    color: rgba(255, 255, 255, 0.78);

    margin: auto;

  }



  .rf-dm-chat-loading-spin {

    font-size: 2rem;

    color: #ff8ab3;

    margin-bottom: 14px;

  }



  .rf-dm-chat-loading p {

    margin: 0 0 6px;

    font-size: 0.95rem;

    font-weight: 800;

  }



  .rf-dm-chat-loading small {

    opacity: 0.72;

    font-size: 0.82rem;

  }

}



/* Desktop stack: lista + chat lado a lado dentro da camada */

@media (min-width: 861px) {

  body.rf-dm-inline-chat-open .rf-stack-layer[data-rf-stack-nav="messages"] .rf-dm-wrap {

    display: grid !important;

    grid-template-columns: minmax(0, 340px) minmax(0, 1fr) !important;

    min-height: 0;

    height: 100%;

  }



  body.rf-dm-inline-chat-open .rf-stack-layer[data-rf-stack-nav="messages"] .rf-dm-list {

    display: flex !important;

    flex-direction: column !important;

    min-height: 0;

    height: 100%;

  }



  body.rf-dm-inline-chat-open .rf-stack-layer[data-rf-stack-nav="messages"] .rf-dm-chat {

    display: grid !important;

    grid-template-rows: auto minmax(0, 1fr) auto !important;

    grid-template-columns: minmax(0, 1fr) !important;

    min-height: 0 !important;

    height: 100% !important;

    max-height: 100% !important;

    overflow: hidden !important;

  }



  body.rf-stack-open #rfStackRoot .rf-dm-chat-overlay:not(.rf-dm-chat-overlay--mobile),

  body.rf-stack-open .rf-dm-chat-overlay:not(.rf-dm-chat-overlay--mobile) {

    display: none !important;

  }

}



@media (min-width: 1100px) {

  body.rf-desktop-ui.rf-dm-inline-chat-open .rf-stack-layer[data-rf-stack-nav="messages"] .rf-dm-wrap {

    grid-template-columns: minmax(0, 400px) minmax(0, 1fr) !important;

  }

}



body.rf-stack-open .rf-tools-sheet.on,

body.rf-stack-open .rf-profile-edit-modal.on,

body.rf-stack-open .rf-quick-post-modal.on,

body.rf-stack-open .rf-dm-modal.on,

body.rf-stack-open .rf-cover-upload-sheet.on,

body.rf-stack-open #rfProfileReelsViewer.on,

body.rf-stack-open.rf-reels-context-profile #rfProfileReelsViewer.on,

body.rf-stack-open .rf-stack-layer.on[data-rf-stack-nav="profile"] .rf-grid-tile,

body.rf-stack-open .rf-stack-layer.on[data-rf-stack-nav="profile"] .rf-grid-tile::after {

  pointer-events: auto !important;

  cursor: pointer !important;

}

body.rf-stack-open .rf-profile-edit-modal.on,

body.rf-stack-open .rf-quick-post-modal.on,

body.rf-stack-open .rf-tools-sheet.on,

body.rf-stack-open .rf-cover-upload-sheet.on,

body.rf-stack-open .rf-dm-modal.on {

  z-index: 2147483200 !important;

}

body.rf-stack-open .rf-profile-edit-modal.on .rf-quick-post-card,

body.rf-stack-open .rf-profile-edit-modal.on .rf-profile-edit-card,

body.rf-stack-open .rf-quick-post-modal.on .rf-quick-post-card,

body.rf-stack-open .rf-quick-post-modal.on .rf-publish-card {

  pointer-events: auto !important;

}

body.rf-stack-open .rf-dm-media-preview.on,

body.rf-dm-media-preview-open .rf-dm-media-preview.on {

  z-index: 2147483200 !important;

  pointer-events: auto !important;

}

body.rf-stack-open .rf-dm-media-preview.on .rf-dm-media-preview-foot,

body.rf-stack-open .rf-dm-media-preview.on .rf-dm-media-preview-head,

body.rf-stack-open .rf-dm-media-preview.on .rf-dm-media-preview-tools,

body.rf-dm-media-preview-open .rf-dm-media-preview.on .rf-dm-media-preview-foot,

body.rf-dm-media-preview-open .rf-dm-media-preview.on .rf-dm-media-preview-head,

body.rf-dm-media-preview-open .rf-dm-media-preview.on .rf-dm-media-preview-tools {

  pointer-events: auto !important;

}



#rfProfileReelsViewer.on {

  position: fixed !important;

  inset: 0 !important;

  width: 100vw !important;

  height: 100dvh !important;

  max-width: none !important;

  z-index: 2147483646 !important;

  pointer-events: auto !important;

}



body.rf-stack-open .rf-dm-chat-overlay.on,

body.rf-stack-open .rf-share-sheet.on,

body.rf-stack-open #rfShareSheet.on,

body.rf-stack-open .rf-comment-sheet-backdrop,

body.rf-stack-open #rfCommentBackdrop,

body.rf-stack-open .rf-comment-sheet,

body.rf-stack-open #rfCommentSheet,

body.rf-stack-open.rf-feed-reels-open #rfFeedReelsViewer.on.rf-kwai-profile-open,

body.rf-stack-open.rf-feed-reels-open #rfFeedReelsViewer.on.rf-kwai-dragging-profile {

  z-index: 2147483200 !important;

}



body.rf-stack-open.rf-comments-open .rf-comment-sheet-backdrop,

body.rf-stack-open.rf-comments-open #rfCommentBackdrop {

  display: block !important;

  pointer-events: auto !important;

}



/* Mensagens em stack — tela cheia, lista+chat no desktop (estilo Instagram) */

body.rf-stack-open .rf-stack-layer[data-rf-stack-nav="messages"] .rf-stack-layer-inner {

  overflow: hidden;

}



body.rf-stack-open .rf-stack-layer[data-rf-stack-nav="messages"] .rf-dm-wrap-page,

body.rf-stack-open .rf-stack-layer[data-rf-stack-nav="messages"] .rf-dm-page-container {

  padding: 0 !important;

  margin: 0 !important;

  max-width: none !important;

  width: 100% !important;

  height: 100%;

  min-height: 0;

}



body.rf-stack-open .rf-stack-layer[data-rf-stack-nav="messages"] .rf-dm-page-head,

body.rf-stack-open .rf-stack-layer[data-rf-stack-nav="messages"] .rf-dm-push-mini,

body.rf-stack-open .rf-stack-layer[data-rf-stack-nav="messages"] #rfPushPanel,

body.rf-stack-open .rf-stack-layer[data-rf-stack-nav="messages"] .rf-dm-call-server-banner {

  display: none !important;

}



body.rf-stack-open .rf-stack-layer[data-rf-stack-nav="messages"] .rf-stack-tab-body {

  overflow: hidden !important;

  display: flex !important;

  flex-direction: column !important;

}



body.rf-stack-open .rf-stack-layer[data-rf-stack-nav="messages"] .rf-stack-page-root {

  display: flex !important;

  flex-direction: column !important;

  flex: 1 1 auto;

  min-height: 0;

  height: 100% !important;

}



body.rf-stack-open .rf-stack-layer[data-rf-stack-nav="messages"] .rf-dm-wrap-page,

body.rf-stack-open .rf-stack-layer[data-rf-stack-nav="messages"] .rf-dm-page-container {

  display: flex !important;

  flex-direction: column !important;

  flex: 1 1 auto !important;

  min-height: 0 !important;

  height: 100% !important;

  max-height: 100% !important;

  overflow: hidden !important;

}



body.rf-stack-open .rf-stack-layer[data-rf-stack-nav="messages"] .rf-dm-wrap {

  flex: 1 1 auto !important;

  height: 100% !important;

  min-height: 0 !important;

  max-height: 100% !important;

  overflow: hidden !important;

  border: 0;

  border-radius: 0;

  margin: 0;

}



body.rf-stack-open .rf-stack-layer[data-rf-stack-nav="messages"] .rf-dm-list {

  background: #07070b;

  position: relative;

  z-index: 2;

}



body.rf-stack-open .rf-stack-layer[data-rf-stack-nav="messages"] .rf-dm-chat {

  display: grid !important;

  grid-template-rows: auto minmax(0, 1fr) auto !important;

  grid-template-columns: minmax(0, 1fr);

  min-height: 0 !important;

  height: 100% !important;

  max-height: 100% !important;

  overflow: hidden !important;

  align-content: stretch;

}



body.rf-stack-open .rf-stack-layer[data-rf-stack-nav="messages"] .rf-dm-chat-head {

  grid-row: 1;

  flex: 0 0 auto;

}



body.rf-stack-open .rf-stack-layer[data-rf-stack-nav="messages"] .rf-dm-messages {

  grid-row: 2;

  flex: 1 1 auto !important;

  min-height: 0 !important;

  overflow-y: auto !important;

  max-height: none !important;

}



body.rf-stack-open .rf-stack-layer[data-rf-stack-nav="messages"] .rf-dm-compose-wrap {

  grid-row: 3;

  flex: 0 0 auto !important;

  display: block !important;

  visibility: visible !important;

  opacity: 1 !important;

  position: relative !important;

  z-index: 5;

  flex-shrink: 0 !important;

  min-height: 56px;

  padding: 8px 12px max(10px, env(safe-area-inset-bottom));

  border-top: 1px solid rgba(255, 255, 255, 0.07);

  background: linear-gradient(180deg, rgba(11, 10, 16, 0.72), rgba(11, 10, 16, 0.98) 28%);

}



body.rf-stack-open .rf-stack-layer[data-rf-stack-nav="messages"] .rf-dm-compose-row {

  display: flex;

  align-items: center;

  gap: 6px;

}



body.rf-stack-open .rf-stack-layer[data-rf-stack-nav="messages"] .rf-dm-compose-pill {

  flex: 1;

  min-width: 0;

  display: flex;

  align-items: center;

  gap: 4px;

  padding: 4px 6px 4px 10px;

  border-radius: 999px;

  border: 1px solid rgba(255, 255, 255, 0.14);

  background: rgba(255, 255, 255, 0.06);

}



body.rf-stack-open .rf-stack-layer[data-rf-stack-nav="messages"] .rf-dm-compose input {

  flex: 1;

  min-width: 0;

  border: 0;

  background: transparent;

  color: #fff;

  padding: 10px 6px;

  font-size: 0.94rem;

  outline: none;

}



body.rf-stack-open .rf-stack-layer[data-rf-stack-nav="messages"] .rf-dm-compose input::placeholder {

  color: rgba(255, 255, 255, 0.42);

}



body.rf-stack-open .rf-stack-layer[data-rf-stack-nav="messages"] .rf-dm-compose-actions {

  display: flex;

  align-items: center;

  gap: 2px;

  flex-shrink: 0;

}



body.rf-stack-open .rf-stack-layer[data-rf-stack-nav="messages"] .rf-dm-compose {

  display: flex;

  flex-direction: column;

  gap: 8px;

}



body.rf-stack-open .rf-stack-layer[data-rf-stack-nav="messages"] .rf-dm-camera-btn,

body.rf-stack-open .rf-stack-layer[data-rf-stack-nav="messages"] .rf-dm-mic-btn {

  width: 40px;

  height: 40px;

  border: 0;

  border-radius: 50%;

  background: transparent;

  color: rgba(255, 255, 255, 0.88);

  font-size: 1.15rem;

  cursor: pointer;

  display: grid;

  place-items: center;

  flex-shrink: 0;

}



@media (min-width: 861px) {

  body.rf-stack-open .rf-stack-layer[data-rf-stack-nav="messages"] .rf-dm-wrap {

    display: grid !important;

    grid-template-columns: minmax(0, 340px) minmax(0, 1fr) !important;

  }



  body.rf-stack-open .rf-stack-layer[data-rf-stack-nav="messages"] .rf-dm-list {

    display: flex !important;

    flex-direction: column !important;

    min-height: 0;

    height: 100%;

    border-right: 1px solid rgba(255, 255, 255, 0.08);

  }



  body.rf-stack-open .rf-stack-layer[data-rf-stack-nav="messages"] .rf-dm-chat {

    display: grid !important;

    grid-template-rows: auto minmax(0, 1fr) auto !important;

    grid-template-columns: minmax(0, 1fr) !important;

    min-height: 0;

    height: 100%;

    max-height: 100%;

    overflow: hidden !important;

  }

}



@media (min-width: 1100px) {

  body.rf-desktop-ui.rf-stack-open .rf-stack-layer[data-rf-stack-nav="messages"] .rf-dm-wrap {

    grid-template-columns: minmax(0, 400px) minmax(0, 1fr) !important;

  }

}



/* Menu inferior visível no chat mobile — ver rf-dm-layout.css */



@media (min-width: 861px) {

  body.rf-desktop-ui.rf-stack-open.rf-dm-inline-chat-open .rf-stack-layer[data-rf-stack-nav="messages"] .rf-dm-wrap-page,

  body.rf-desktop-ui.rf-stack-open.rf-dm-inline-chat-open .rf-dm-wrap-page,

  body.rf-desktop-ui.rf-stack-open.rf-dm-inline-chat-open .rf-stack-layer[data-rf-stack-nav="messages"] .rf-dm-page-container,

  body.rf-desktop-ui.rf-stack-open.rf-dm-inline-chat-open .rf-dm-page-container {

    height: 100% !important;

    max-height: 100% !important;

    min-height: 0 !important;

    flex: 1 1 auto !important;

    overflow: hidden !important;

  }



  body.rf-desktop-ui.rf-stack-open.rf-dm-inline-chat-open .rf-stack-layer[data-rf-stack-nav="messages"] .rf-dm-wrap,

  body.rf-desktop-ui.rf-stack-open.rf-dm-inline-chat-open.rf-dm-has-thread .rf-stack-layer[data-rf-stack-nav="messages"] .rf-dm-wrap {

    height: 100% !important;

    max-height: 100% !important;

    min-height: 0 !important;

    overflow: hidden !important;

    display: grid !important;

    grid-template-columns: minmax(0, 340px) minmax(0, 1fr) !important;

  }



  body.rf-desktop-ui.rf-stack-open.rf-dm-inline-chat-open .rf-stack-layer[data-rf-stack-nav="messages"] .rf-dm-list {

    display: flex !important;

  }

}



/* === DM duas colunas: lista (scroll) | chat (msgs scroll + barra FIXA embaixo) === */

body.rf-stack-open .rf-stack-layer[data-rf-stack-nav="messages"] .rf-dm-list {

  display: flex !important;

  flex-direction: column !important;

  min-height: 0 !important;

  height: 100% !important;

  max-height: 100% !important;

  overflow: hidden !important;

}



body.rf-stack-open .rf-stack-layer[data-rf-stack-nav="messages"] .rf-dm-list .rf-dm-items {

  flex: 1 1 auto !important;

  min-height: 0 !important;

  overflow-y: auto !important;

  overflow-x: hidden !important;

  -webkit-overflow-scrolling: touch;

}



body.rf-stack-open .rf-stack-layer[data-rf-stack-nav="messages"] .rf-dm-chat.rf-dm-chat-active,

body.rf-stack-open .rf-stack-layer[data-rf-stack-nav="messages"] .rf-dm-chat:has(#rfDmCompose) {

  position: relative !important;

  display: flex !important;

  flex-direction: column !important;

  height: 100% !important;

  max-height: 100% !important;

  min-height: 0 !important;

  overflow: hidden !important;

}



body.rf-stack-open .rf-stack-layer[data-rf-stack-nav="messages"] .rf-dm-chat.rf-dm-chat-active .rf-dm-chat-head,

body.rf-stack-open .rf-stack-layer[data-rf-stack-nav="messages"] .rf-dm-chat:has(#rfDmCompose) .rf-dm-chat-head {

  flex: 0 0 auto !important;

  position: relative !important;

  z-index: 12 !important;

}



body.rf-stack-open .rf-stack-layer[data-rf-stack-nav="messages"] .rf-dm-chat.rf-dm-chat-active .rf-dm-messages,

body.rf-stack-open .rf-stack-layer[data-rf-stack-nav="messages"] .rf-dm-chat:has(#rfDmCompose) .rf-dm-messages {

  flex: 1 1 auto !important;

  min-height: 0 !important;

  overflow-y: auto !important;

  overflow-x: hidden !important;

  -webkit-overflow-scrolling: touch;

  padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px)) !important;

}



body.rf-stack-open .rf-stack-layer[data-rf-stack-nav="messages"] .rf-dm-chat.rf-dm-chat-active .rf-dm-compose-wrap,

body.rf-stack-open .rf-stack-layer[data-rf-stack-nav="messages"] .rf-dm-chat:has(#rfDmCompose) .rf-dm-compose-wrap {

  position: absolute !important;

  left: 0 !important;

  right: 0 !important;

  bottom: 0 !important;

  top: auto !important;

  z-index: 40 !important;

  display: block !important;

  visibility: visible !important;

  opacity: 1 !important;

  pointer-events: auto !important;

  flex: none !important;

  min-height: 56px !important;

  padding: 8px 12px max(10px, env(safe-area-inset-bottom)) !important;

  border-top: 1px solid rgba(255, 255, 255, 0.07) !important;

  background: linear-gradient(180deg, rgba(11, 10, 16, 0.72), rgba(11, 10, 16, 0.98) 28%) !important;

  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.35) !important;

}

/* Mobile DM — folha full-screen no body (fora da lista, slide direita) */
.rf-dm-chat-overlay.rf-dm-chat-overlay--mobile {
  position: fixed !important;
  inset: 0 !important;
  z-index: 2147483646 !important;
  display: flex !important;
  flex-direction: column !important;
  background: #07070b !important;
  visibility: hidden;
  pointer-events: none;
  transform: translate3d(100%, 0, 0);
  transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1);
}

.rf-dm-chat-overlay.rf-dm-chat-overlay--mobile.on {
  display: flex !important;
  visibility: visible;
  pointer-events: auto;
  transform: translate3d(0, 0, 0);
}

body.rf-stack-open .rf-dm-chat-overlay.rf-dm-chat-overlay--mobile.on {
  display: flex !important;
  visibility: visible !important;
  pointer-events: auto !important;
  z-index: 2147483646 !important;
}

body > #rfDmChatOverlay.rf-dm-chat-overlay--mobile.on {
  position: fixed !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  max-height: 100dvh !important;
  display: flex !important;
  visibility: visible !important;
  pointer-events: auto !important;
  z-index: 2147483647 !important;
  transform: translate3d(0, 0, 0) !important;
}

.rf-dm-chat-overlay.rf-dm-chat-overlay--mobile.rf-dm-chat-overlay--closing {
  visibility: visible;
  pointer-events: none;
  transform: translate3d(100%, 0, 0);
}

.rf-dm-chat-overlay.rf-dm-chat-overlay--mobile.rf-dm-chat-overlay--instant {
  transition: none !important;
}

.rf-dm-chat-overlay.rf-dm-chat-overlay--mobile .rf-dm-chat-overlay-body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
}

.rf-dm-chat-overlay.rf-dm-chat-overlay--mobile .rf-dm-mobile-sheet {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  display: grid !important;
  grid-template-rows: auto minmax(0, 1fr) auto !important;
  overflow: hidden;
  background: #07070b;
}

.rf-dm-chat-overlay.rf-dm-chat-overlay--mobile .rf-dm-mobile-sheet .rf-dm-chat-head {
  padding-top: max(12px, env(safe-area-inset-top, 0px));
}

.rf-dm-chat-overlay.rf-dm-chat-overlay--mobile .rf-dm-mobile-sheet .rf-dm-chat-head #rfDmBackBtn {
  display: inline-flex !important;
}

/* Studio / modais sempre acima da stack (perfil, reels viewer) */
body.rf-modal-open .rf-publish-modal.on,
body.rf-modal-open .rf-quick-post-modal.on,
body.rf-studio-immersive .rf-publish-modal.on,
body.rf-studio-immersive .rf-quick-post-modal.on {
  z-index: 2147483655 !important;
  pointer-events: auto !important;
}
/* #rfCeSheets cobre a viewport: só sheets abertas recebem clique (não bloquear o studio) */
body.rf-modal-open #rfCeSheets,
body.rf-studio-immersive #rfCeSheets {
  z-index: 2147483660 !important;
  pointer-events: none !important;
}
body.rf-modal-open #rfCeSheets .rf-ce-sheet.is-on,
body.rf-studio-immersive #rfCeSheets .rf-ce-sheet.is-on {
  pointer-events: auto !important;
}
body.rf-modal-open #rfCeExitDialog.on,
body.rf-modal-open .rf-ce-exit-dialog.on {
  z-index: 2147483660 !important;
  pointer-events: auto !important;
}
body.rf-modal-open.rf-studio-immersive #rfPublishLock {
  display: none !important;
  pointer-events: none !important;
}
body.rf-modal-open #rfStackRoot,
body.rf-studio-immersive #rfStackRoot,
body.rf-modal-open .rf-stack-layer.on,
body.rf-studio-immersive .rf-stack-layer.on {
  visibility: hidden !important;
  pointer-events: none !important;
}
body.rf-modal-open #rfProfileReelsViewer.on,
body.rf-studio-immersive #rfProfileReelsViewer.on {
  z-index: 2147482600 !important;
  pointer-events: none !important;
  visibility: hidden !important;
}


