/* Banana Friends · Grupos · Rediseño visual 01 (2026-10-31)
   Cambios limitados a /planes?view=grupos. Planes no se ve afectado. */

/* Superficie gris neutra, como la nueva página Planes. */
html body.bf-page-planes.bf-page-groups {
  background: #f3f4f6 !important;
  color: #151515;
}
html body.bf-page-planes.bf-page-groups > .app {
  background: transparent !important;
  background-image: none !important;
}

/* Sin card ni texto secundario: solo el título negro. */
html body.bf-page-planes.bf-page-groups #planesGruposWrap .pg-head {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  width: 100% !important;
  min-height: 52px !important;
  padding: 0 !important;
  margin: 0 0 14px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}
html body.bf-page-planes.bf-page-groups #planesGruposWrap .pg-head .pg-title {
  margin: 0 !important;
  padding: 0 !important;
  color: #151515 !important;
  -webkit-text-fill-color: #151515 !important;
  font-size: clamp(1.65rem, 2.5vw, 2rem) !important;
  line-height: 1.15 !important;
  font-weight: 750 !important;
  letter-spacing: -.045em !important;
}

/* Acción + en la cabecera compartida, ANTES del logo, solo en Grupos.
   La cabecera móvil ya posiciona .bf-web-create-link en el margen izquierdo. */
@media (min-width: 900px) {
  html body.bf-page-groups > .bf-web-header[data-bf-header] .bf-web-group-create-link {
    display: grid !important;
    position: relative !important;
    inset: auto !important;
    flex: 0 0 42px !important;
    width: 42px !important;
    height: 42px !important;
    place-items: center !important;
    margin: 0 2px 0 0 !important;
    padding: 0 !important;
    border: 1px solid rgba(24, 24, 27, .12) !important;
    border-radius: 13px !important;
    background: #ffffff !important;
    color: #151515 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .045) !important;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    transition: background-color .18s ease, border-color .18s ease, transform .18s ease;
  }
  html body.bf-page-groups > .bf-web-header[data-bf-header] .bf-web-group-create-link svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
  }
  html body.bf-page-groups > .bf-web-header[data-bf-header] .bf-web-group-create-link:hover {
    background: #e9eaec !important;
    border-color: rgba(24, 24, 27, .22) !important;
  }
  html body.bf-page-groups > .bf-web-header[data-bf-header] .bf-web-group-create-link:active {
    transform: scale(.96);
  }
}
html body.bf-page-groups > .bf-web-header[data-bf-header] .bf-web-group-create-link:focus-visible {
  outline: 2px solid #151515 !important;
  outline-offset: 3px !important;
}
@media (max-width: 899px) {
  /* La regla de la cabecera móvil establece un área táctil de 44 px. */
  html body.bf-page-groups > .bf-web-header[data-bf-header] .bf-web-group-create-link {
    color: #151515 !important;
    -webkit-tap-highlight-color: transparent;
  }
  html body.bf-page-groups #planesGruposWrap .pg-head {
    margin-bottom: 10px !important;
    min-height: 45px !important;
  }
}
@media (prefers-reduced-motion: reduce) {
  html body.bf-page-groups > .bf-web-header[data-bf-header] .bf-web-group-create-link {
    transition: none !important;
  }
}

/* El modal de Grupos debe cubrir también la cabecera sticky de escritorio.
   La cabecera compartida tiene z-index:1900; el modal anterior usaba 1201. */
html body.bf-page-planes.bf-page-groups #pgOverlay {
  z-index: 2300 !important;
}
html body.bf-page-planes.bf-page-groups #pgSheet {
  z-index: 2301 !important;
}

/* Grupos 1.9: altura natural. Sin desplazamiento por espacio reservado en blanco.
   La bandeja crece cuando hay conversaciones; conserva espacio para menú inferior móvil. */
html body.bf-page-planes.bf-page-groups > .app {
  scroll-snap-type:none!important;
  scroll-behavior:auto!important;
  padding-bottom:0!important;
  overscroll-behavior-y:contain;
}
html body.bf-page-planes.bf-page-groups #planesGruposWrap {
  min-height:0!important;
  padding-bottom:20px!important;
  margin-bottom:0!important;
}
@media(max-width:760px){
  html body.bf-page-planes.bf-page-groups > .app {
    padding-bottom:calc(76px + env(safe-area-inset-bottom,0px))!important;
  }
  html body.bf-page-planes.bf-page-groups #planesGruposWrap {padding-bottom:0!important;}
}
/* El contenedor de Grupos es la superficie desplazable, solo si su contenido no cabe. */
html body.bf-page-planes.bf-page-groups > .app {
  box-sizing:border-box!important;
  height:100dvh!important;
  min-height:0!important;
  max-height:100dvh!important;
  overflow-y:auto!important;
  -webkit-overflow-scrolling:touch;
}
/* Con poco contenido, centra la sección en el espacio útil. Con muchos chats,
   los márgenes automáticos se reducen y el contenido se desplaza normalmente. */
html body.bf-page-planes.bf-page-groups > .app {
  display:flex!important;
  flex-direction:column!important;
  align-items:stretch!important;
}
html body.bf-page-planes.bf-page-groups > .app > #topSnap {display:none!important;}
html body.bf-page-planes.bf-page-groups > .app > #planesGruposWrap {
  flex:0 0 auto!important;
  margin-top:auto!important;
  margin-bottom:auto!important;
}
