/* El Contraataque · Community Chat Polish v62
   Última capa visual: replica la pantalla de chat aprobada sin alterar datos ni envío de comentarios. */

body[data-screen="communityPostDetail"]{
  --ec62-gold:#d59420;
  --ec62-gold-dark:#a86606;
  --ec62-ink:#17130f;
  --ec62-muted:#7a746c;
  --ec62-line:rgba(65,50,31,.10);
  --ec62-dock-h:4.6rem;
}

/* Cabecera de Comunidad: compacta, blanca y estable. */
body[data-screen="communityPostDetail"].community-hub-mode .community-hub-header{
  position:sticky!important;
  top:0!important;
  z-index:94!important;
  min-height:4.25rem!important;
  margin:0 0 .55rem!important;
  padding:.55rem .68rem!important;
  border:0!important;
  border-bottom:1px solid rgba(50,39,26,.055)!important;
  border-radius:0!important;
  background:rgba(255,255,255,.985)!important;
  box-shadow:0 .18rem .65rem rgba(46,34,17,.035)!important;
  backdrop-filter:blur(18px)!important;
  -webkit-backdrop-filter:blur(18px)!important;
}
body[data-screen="communityPostDetail"].community-hub-mode .community-hub-exit{
  min-height:2.75rem!important;
  border:1px solid rgba(48,39,29,.12)!important;
  border-radius:999px!important;
  padding:0 .78rem!important;
  color:#3c352d!important;
  background:#fff!important;
  box-shadow:none!important;
  font-size:clamp(.6rem,2.5vw,.72rem)!important;
  font-weight:850!important;
}
body[data-screen="communityPostDetail"].community-hub-mode .community-hub-level{
  min-height:2.65rem!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  border:1px solid rgba(194,125,15,.36)!important;
  border-radius:999px!important;
  padding:0 .8rem!important;
  color:#8e5705!important;
  background:#fffaf0!important;
  font-size:clamp(.55rem,2.2vw,.67rem)!important;
  font-weight:850!important;
  white-space:nowrap!important;
}

/* Hero aprobado: foto izquierda, bloque oro central y marca de agua derecha. */
body[data-screen="communityPostDetail"].community-hub-mode .community-topic-hero-v41{
  position:relative!important;
  top:auto!important;
  z-index:3!important;
  isolation:isolate!important;
  display:grid!important;
  grid-template-columns:29% minmax(0,71%)!important;
  align-items:stretch!important;
  gap:0!important;
  width:100%!important;
  min-height:8.25rem!important;
  max-height:none!important;
  margin:0 0 .7rem!important;
  overflow:hidden!important;
  border:1px solid rgba(188,116,8,.34)!important;
  border-radius:1.05rem!important;
  padding:0!important;
  color:var(--ec62-ink)!important;
  background:#fffaf2!important;
  box-shadow:0 .38rem 1rem rgba(54,38,13,.045)!important;
  backdrop-filter:none!important;
  -webkit-backdrop-filter:none!important;
  transform:none!important;
  clip-path:none!important;
}
body[data-screen="communityPostDetail"].community-hub-mode .community-topic-hero-v41::before{
  display:none!important;
  content:none!important;
}
body[data-screen="communityPostDetail"].community-hub-mode .community-topic-hero-v41::after{
  display:block!important;
  content:""!important;
  position:absolute!important;
  z-index:0!important;
  top:50%!important;
  right:.65rem!important;
  width:4.8rem!important;
  height:4.8rem!important;
  opacity:.07!important;
  background:url('/assets/icons/icono-rm-logo.svg') center/contain no-repeat!important;
  transform:translateY(-50%)!important;
  clip-path:none!important;
  pointer-events:none!important;
}
body[data-screen="communityPostDetail"].community-hub-mode .community-topic-hero-v41__image{
  position:relative!important;
  z-index:2!important;
  align-self:stretch!important;
  display:block!important;
  width:100%!important;
  height:auto!important;
  min-height:8.25rem!important;
  max-height:none!important;
  overflow:hidden!important;
  margin:0!important;
  border:0!important;
  border-radius:1rem 0 0 1rem!important;
  padding:0!important;
  background:#f3eee5!important;
  transform:none!important;
  clip-path:none!important;
}
body[data-screen="communityPostDetail"].community-hub-mode .community-topic-hero-v41__image img{
  display:block!important;
  width:100%!important;
  height:100%!important;
  min-height:8.25rem!important;
  object-fit:cover!important;
  object-position:center 18%!important;
  border:0!important;
  border-radius:0!important;
  background:transparent!important;
  transform:none!important;
  clip-path:none!important;
}
body[data-screen="communityPostDetail"].community-hub-mode .community-topic-hero-v41__copy{
  position:relative!important;
  z-index:1!important;
  align-self:stretch!important;
  display:grid!important;
  align-content:center!important;
  gap:.3rem!important;
  min-width:0!important;
  min-height:8.25rem!important;
  margin:0 4.25rem 0 0!important;
  border-radius:0 4.3rem 4.3rem 0!important;
  padding:.72rem .78rem .7rem 1rem!important;
  color:#17130f!important;
  background:var(--ec62-gold)!important;
  box-shadow:none!important;
  transform:none!important;
  clip-path:none!important;
}
body[data-screen="communityPostDetail"].community-hub-mode .community-topic-hero-v41__copy>small{
  justify-self:start!important;
  margin:0 0 .05rem!important;
  border:1px solid rgba(169,102,5,.28)!important;
  border-radius:999px!important;
  padding:.22rem .56rem!important;
  color:#a56405!important;
  background:#fff!important;
  font-size:clamp(.52rem,2.2vw,.61rem)!important;
  font-weight:950!important;
  letter-spacing:.09em!important;
  line-height:1!important;
}
body[data-screen="communityPostDetail"].community-hub-mode .community-topic-hero-v41__copy h3{
  margin:.03rem 0 0!important;
  overflow:visible!important;
  color:#0d0b09!important;
  font-size:clamp(1.12rem,5vw,1.45rem)!important;
  font-weight:1000!important;
  line-height:1.02!important;
  letter-spacing:-.035em!important;
  text-overflow:clip!important;
  white-space:normal!important;
  -webkit-text-fill-color:#0d0b09!important;
}
body[data-screen="communityPostDetail"].community-hub-mode .community-topic-hero-v41__copy p{
  display:-webkit-box!important;
  margin:0!important;
  overflow:hidden!important;
  color:#2c2419!important;
  font-size:clamp(.65rem,2.55vw,.75rem)!important;
  font-weight:500!important;
  line-height:1.25!important;
  -webkit-box-orient:vertical!important;
  -webkit-line-clamp:2!important;
  -webkit-text-fill-color:#2c2419!important;
}
body[data-screen="communityPostDetail"].community-hub-mode .community-topic-hero-v41__stats{
  display:flex!important;
  flex-wrap:wrap!important;
  align-items:center!important;
  gap:.28rem .7rem!important;
  margin-top:.05rem!important;
  color:#4b3516!important;
  opacity:1!important;
  font-size:clamp(.54rem,2.2vw,.63rem)!important;
  font-weight:750!important;
}
body[data-screen="communityPostDetail"].community-hub-mode .community-topic-hero-v41__stats>span{
  display:inline-flex!important;
  align-items:center!important;
  gap:.24rem!important;
  color:inherit!important;
  opacity:1!important;
}
body[data-screen="communityPostDetail"].community-hub-mode .community-topic-hero-v41__stats svg{
  width:.9rem!important;
  height:.9rem!important;
  fill:none!important;
  stroke:currentColor!important;
  stroke-width:1.7!important;
}
/* En este diseño el hero no muta al hacer scroll: evita saltos y deformaciones. */
body[data-screen="communityPostDetail"].community-hub-mode .community-topic-hero-v41.is-compact{
  grid-template-columns:29% minmax(0,71%)!important;
  min-height:8.25rem!important;
  border-radius:1.05rem!important;
  padding:0!important;
}
body[data-screen="communityPostDetail"].community-hub-mode .community-topic-hero-v41.is-compact .community-topic-hero-v41__image{
  width:100%!important;
  height:auto!important;
  min-height:8.25rem!important;
  border-radius:1rem 0 0 1rem!important;
}
body[data-screen="communityPostDetail"].community-hub-mode .community-topic-hero-v41.is-compact .community-topic-hero-v41__copy{
  display:grid!important;
  grid-template-columns:1fr!important;
  min-height:8.25rem!important;
  gap:.3rem!important;
}
body[data-screen="communityPostDetail"].community-hub-mode .community-topic-hero-v41.is-compact .community-topic-hero-v41__copy p,
body[data-screen="communityPostDetail"].community-hub-mode .community-topic-hero-v41.is-compact .community-topic-hero-v41__stats{
  display:flex!important;
}

/* Tarjeta de comentarios, como en el briefing. */
body[data-screen="communityPostDetail"].community-hub-mode .community-chat-v41 .post-comments{
  position:relative!important;
  display:block!important;
  width:100%!important;
  margin:0!important;
  overflow:visible!important;
  border:1px solid var(--ec62-line)!important;
  border-radius:1.05rem!important;
  padding:0 .72rem calc(var(--ec62-dock-h) + 1.15rem)!important;
  background:#fff!important;
  box-shadow:0 .25rem .8rem rgba(45,34,20,.035)!important;
}
body[data-screen="communityPostDetail"].community-hub-mode .community-chat-v41 .post-comments__head{
  display:flex!important;
  min-height:3.35rem!important;
  align-items:center!important;
  justify-content:space-between!important;
  gap:.6rem!important;
  margin:0 -.72rem .25rem!important;
  border:0!important;
  border-bottom:1px solid rgba(48,39,29,.085)!important;
  border-radius:1.05rem 1.05rem 0 0!important;
  padding:0 .86rem!important;
  color:#17130f!important;
  background:#fff!important;
  box-shadow:none!important;
}
body[data-screen="communityPostDetail"].community-hub-mode .community-chat-v41 .post-comments__head>span:first-child,
body[data-screen="communityPostDetail"].community-hub-mode .community-chat-v41 .post-comments__head>strong{
  display:block!important;
  color:#17130f!important;
  font-size:clamp(.7rem,3vw,.82rem)!important;
  font-weight:950!important;
  line-height:1!important;
}
body[data-screen="communityPostDetail"].community-hub-mode .community-chat-v41 .post-comments__head>small{
  display:none!important;
}
body[data-screen="communityPostDetail"].community-hub-mode .community-chat-v41 .comment-order-switch{
  display:none!important;
}
body[data-screen="communityPostDetail"].community-hub-mode .community-v62-order-button{
  display:grid!important;
  width:2.15rem!important;
  height:2.15rem!important;
  place-items:center!important;
  flex:0 0 2.15rem!important;
  border:0!important;
  border-radius:50%!important;
  padding:0!important;
  color:#b06b06!important;
  background:transparent!important;
}
body[data-screen="communityPostDetail"].community-hub-mode .community-v62-order-button svg{
  width:1.15rem!important;
  height:1.15rem!important;
  fill:none!important;
  stroke:currentColor!important;
  stroke-width:1.8!important;
  stroke-linecap:round!important;
}
body[data-screen="communityPostDetail"].community-hub-mode .community-v62-order-menu{
  position:absolute!important;
  z-index:130!important;
  top:2.8rem!important;
  right:.55rem!important;
  display:grid!important;
  min-width:9.6rem!important;
  gap:.15rem!important;
  border:1px solid rgba(48,39,28,.10)!important;
  border-radius:.85rem!important;
  padding:.35rem!important;
  background:#fff!important;
  box-shadow:0 .55rem 1.4rem rgba(46,34,18,.13)!important;
}
body[data-screen="communityPostDetail"].community-hub-mode .community-v62-order-menu[hidden]{display:none!important}
body[data-screen="communityPostDetail"].community-hub-mode .community-v62-order-menu button{
  min-height:2.25rem!important;
  border:0!important;
  border-radius:.62rem!important;
  padding:0 .7rem!important;
  color:#3b352e!important;
  background:#fff!important;
  font-size:.65rem!important;
  font-weight:800!important;
  text-align:left!important;
}
body[data-screen="communityPostDetail"].community-hub-mode .community-v62-order-menu button.is-selected{
  color:#965b05!important;
  background:#fff4dc!important;
}
body[data-screen="communityPostDetail"].community-hub-mode .community-chat-v41 .post-comments__list{
  display:grid!important;
  gap:0!important;
  padding:.08rem 0 .6rem!important;
  background:transparent!important;
}
body[data-screen="communityPostDetail"].community-hub-mode .community-chat-v41 .post-comment-thread{
  margin:0!important;
}
body[data-screen="communityPostDetail"].community-hub-mode .community-chat-v41 .post-comment{
  display:grid!important;
  grid-template-columns:2.3rem minmax(0,1fr)!important;
  align-items:start!important;
  gap:.48rem!important;
  margin:0!important;
  border:0!important;
  padding:.34rem 0 .4rem!important;
  background:transparent!important;
}
body[data-screen="communityPostDetail"].community-hub-mode .community-chat-v41 .post-comment>.avatar{
  width:2.3rem!important;
  height:2.3rem!important;
  border:1px solid rgba(68,56,40,.10)!important;
  border-radius:50%!important;
  background:#f4f1eb!important;
  box-shadow:none!important;
  font-size:.65rem!important;
}
body[data-screen="communityPostDetail"].community-hub-mode .community-v53-message-bubble{
  width:auto!important;
  max-width:calc(100% - 2.2rem)!important;
  border:0!important;
  border-radius:.25rem .95rem .95rem .95rem!important;
  padding:.5rem .66rem .56rem!important;
  color:#201c18!important;
  background:#f3f3f2!important;
  box-shadow:none!important;
}
body[data-screen="communityPostDetail"].community-hub-mode .community-v53-message-bubble>strong{
  font-size:clamp(.66rem,2.65vw,.75rem)!important;
  line-height:1.12!important;
}
body[data-screen="communityPostDetail"].community-hub-mode .community-v53-message-bubble>small{
  color:#817b74!important;
  font-size:.52rem!important;
}
body[data-screen="communityPostDetail"].community-hub-mode .community-v53-message-bubble .post-comment__body{
  margin:.16rem 0 0!important;
  padding:0!important;
  color:#201c18!important;
  font-size:clamp(.75rem,3.1vw,.86rem)!important;
  line-height:1.32!important;
}
body[data-screen="communityPostDetail"].community-hub-mode .community-chat-v41 .post-comment__actions{
  min-height:1.25rem!important;
  margin:.1rem 0 0!important;
}
body[data-screen="communityPostDetail"].community-hub-mode .community-chat-v41 .post-comment__actions [data-comment-reply]{
  min-height:1.25rem!important;
  padding:0!important;
  font-size:.57rem!important;
  font-weight:800!important;
}
body[data-screen="communityPostDetail"].community-hub-mode .community-v41-like-button{
  right:.05rem!important;
  top:50%!important;
  width:1.9rem!important;
  height:1.9rem!important;
  transform:translateY(-50%)!important;
}
body[data-screen="communityPostDetail"].community-hub-mode .community-v41-like-button svg{
  width:1.25rem!important;
  height:1.25rem!important;
  stroke-width:1.65!important;
}
body[data-screen="communityPostDetail"].community-hub-mode .community-v52-day-separator,
body[data-screen="communityPostDetail"].community-hub-mode .community-v41-new-separator{
  margin:.28rem 0 .16rem!important;
  font-size:.55rem!important;
  font-weight:850!important;
}

/* Composer: una sola barra compacta, sin solapamientos. */
body[data-screen="communityPostDetail"].community-hub-mode .community-chat-v41 .post-comment-form.community-v62-composer{
  position:fixed!important;
  z-index:150!important;
  right:0!important;
  bottom:calc(var(--keyboard-offset,0px))!important;
  left:0!important;
  display:grid!important;
  grid-template-columns:2.2rem minmax(0,1fr) 2.25rem 2.55rem!important;
  align-items:center!important;
  gap:.36rem!important;
  width:100%!important;
  max-width:none!important;
  min-height:var(--ec62-dock-h)!important;
  margin:0!important;
  border:0!important;
  border-top:1px solid rgba(51,41,29,.08)!important;
  border-radius:0!important;
  padding:.48rem max(.62rem,env(safe-area-inset-right)) max(.48rem,env(safe-area-inset-bottom)) max(.62rem,env(safe-area-inset-left))!important;
  background:rgba(255,255,255,.985)!important;
  box-shadow:0 -.35rem 1rem rgba(48,36,20,.055)!important;
  backdrop-filter:blur(18px)!important;
  -webkit-backdrop-filter:blur(18px)!important;
  transform:none!important;
}
body[data-screen="communityPostDetail"].community-hub-mode .community-v62-composer .community-v60-composer-avatar,
body[data-screen="communityPostDetail"].community-hub-mode .community-v62-composer .community-v62-composer-avatar{
  grid-column:1!important;
  grid-row:1!important;
  display:grid!important;
  width:2.2rem!important;
  height:2.2rem!important;
  place-items:center!important;
  overflow:hidden!important;
  margin:0!important;
  border:1px solid rgba(85,70,51,.11)!important;
  border-radius:50%!important;
  color:#9c6207!important;
  background:#f4f0e7!important;
  font-size:.62rem!important;
  font-weight:900!important;
}
body[data-screen="communityPostDetail"].community-hub-mode .community-v62-composer .community-v60-composer-avatar img,
body[data-screen="communityPostDetail"].community-hub-mode .community-v62-composer .community-v62-composer-avatar img{
  width:100%!important;
  height:100%!important;
  object-fit:cover!important;
}
body[data-screen="communityPostDetail"].community-hub-mode .community-v62-composer textarea{
  grid-column:2!important;
  grid-row:1!important;
  width:100%!important;
  min-width:0!important;
  height:2.55rem!important;
  min-height:2.55rem!important;
  max-height:6rem!important;
  margin:0!important;
  resize:none!important;
  overflow-y:auto!important;
  border:1px solid rgba(58,48,36,.12)!important;
  border-radius:999px!important;
  outline:0!important;
  padding:.62rem .82rem!important;
  color:#25211c!important;
  background:#fff!important;
  box-shadow:none!important;
  font-size:16px!important;
  line-height:1.2!important;
}
body[data-screen="communityPostDetail"].community-hub-mode .community-v62-composer textarea::placeholder{
  color:#9a948c!important;
  opacity:1!important;
}
body[data-screen="communityPostDetail"].community-hub-mode .community-v62-composer .comment-image-input{
  position:relative!important;
  grid-column:3!important;
  grid-row:1!important;
  display:grid!important;
  width:2.25rem!important;
  height:2.25rem!important;
  min-height:0!important;
  place-items:center!important;
  overflow:hidden!important;
  margin:0!important;
  border:1px solid rgba(58,48,36,.12)!important;
  border-radius:50%!important;
  padding:0!important;
  color:transparent!important;
  background:#fff!important;
  font-size:0!important;
}
body[data-screen="communityPostDetail"].community-hub-mode .community-v62-composer .comment-image-input::before{
  content:""!important;
  width:1.18rem!important;
  height:1.08rem!important;
  border:1.55px solid #5e5953!important;
  border-radius:.16rem!important;
  background:radial-gradient(circle at 72% 28%,#5e5953 0 .09rem,transparent .1rem),linear-gradient(135deg,transparent 43%,#5e5953 44% 49%,transparent 50%) 10% 80%/70% 55% no-repeat!important;
}
body[data-screen="communityPostDetail"].community-hub-mode .community-v62-composer .comment-image-input input{
  position:absolute!important;
  inset:0!important;
  width:100%!important;
  height:100%!important;
  min-height:0!important;
  margin:0!important;
  opacity:0!important;
  cursor:pointer!important;
}
body[data-screen="communityPostDetail"].community-hub-mode .community-v62-composer .comment-emoji-row,
body[data-screen="communityPostDetail"].community-hub-mode .community-v62-composer .community-v41-emoji-button,
body[data-screen="communityPostDetail"].community-hub-mode .community-v62-composer .community-v41-more-button{
  display:none!important;
}
body[data-screen="communityPostDetail"].community-hub-mode .community-v62-composer>button[type="submit"]{
  grid-column:4!important;
  grid-row:1!important;
  display:grid!important;
  width:2.55rem!important;
  height:2.55rem!important;
  min-width:2.55rem!important;
  min-height:2.55rem!important;
  place-items:center!important;
  margin:0!important;
  border:0!important;
  border-radius:50%!important;
  padding:0!important;
  color:#fff!important;
  background:linear-gradient(145deg,#e4a524,#c57a05)!important;
  box-shadow:0 .2rem .55rem rgba(178,105,4,.16)!important;
  font-size:0!important;
  opacity:1!important;
}
body[data-screen="communityPostDetail"].community-hub-mode .community-v62-composer>button[type="submit"]::before{
  content:""!important;
  width:1.15rem!important;
  height:1.15rem!important;
  background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 2 11 13'/%3E%3Cpath d='m22 2-7 20-4-9-9-4Z'/%3E%3C/svg%3E") center/contain no-repeat!important;
  transform:none!important;
}
body[data-screen="communityPostDetail"].community-hub-mode .community-v62-composer>button[type="submit"]:disabled{
  opacity:.45!important;
}
body[data-screen="communityPostDetail"].community-hub-mode #communityPostDetail{
  padding-bottom:calc(var(--ec62-dock-h) + 1rem + env(safe-area-inset-bottom))!important;
}
body[data-screen="communityPostDetail"].community-hub-mode .mobile-content{
  padding-bottom:calc(var(--ec62-dock-h) + env(safe-area-inset-bottom))!important;
  scroll-padding-bottom:calc(var(--ec62-dock-h) + 1rem + env(safe-area-inset-bottom))!important;
}

@media(max-width:390px){
  body[data-screen="communityPostDetail"].community-hub-mode .community-hub-header{padding-inline:.5rem!important}
  body[data-screen="communityPostDetail"].community-hub-mode .community-hub-exit{padding-inline:.55rem!important;font-size:.58rem!important}
  body[data-screen="communityPostDetail"].community-hub-mode .community-hub-level{padding-inline:.55rem!important;font-size:.53rem!important}
  body[data-screen="communityPostDetail"].community-hub-mode .community-topic-hero-v41,
  body[data-screen="communityPostDetail"].community-hub-mode .community-topic-hero-v41.is-compact{grid-template-columns:30% minmax(0,70%)!important;min-height:7.65rem!important}
  body[data-screen="communityPostDetail"].community-hub-mode .community-topic-hero-v41__image,
  body[data-screen="communityPostDetail"].community-hub-mode .community-topic-hero-v41__image img{min-height:7.65rem!important}
  body[data-screen="communityPostDetail"].community-hub-mode .community-topic-hero-v41__copy{min-height:7.65rem!important;margin-right:3.5rem!important;padding:.62rem .62rem .6rem .72rem!important}
  body[data-screen="communityPostDetail"].community-hub-mode .community-topic-hero-v41::after{right:.4rem!important;width:4rem!important;height:4rem!important}
  body[data-screen="communityPostDetail"].community-hub-mode .community-topic-hero-v41__copy h3{font-size:1.08rem!important}
  body[data-screen="communityPostDetail"].community-hub-mode .community-topic-hero-v41__copy p{font-size:.62rem!important}
  body[data-screen="communityPostDetail"].community-hub-mode .community-v53-message-bubble{max-width:calc(100% - 1.9rem)!important}
  body[data-screen="communityPostDetail"].community-hub-mode .community-v62-composer{grid-template-columns:2.05rem minmax(0,1fr) 2.15rem 2.45rem!important;gap:.28rem!important;padding-inline:.48rem!important}
  body[data-screen="communityPostDetail"].community-hub-mode .community-v62-composer .community-v60-composer-avatar,
  body[data-screen="communityPostDetail"].community-hub-mode .community-v62-composer .community-v62-composer-avatar{width:2.05rem!important;height:2.05rem!important}
}
