/* iMessage blocked-room behavior v135 */

/* Blocked DM: there is no typing surface at all, matching native Messages.
   The wallpaper remains full height and the message viewport keeps only a tiny
   bottom guard instead of reserving the former composer height. */
html[data-social-app="imessage"] .imessage-v19[data-im135-blocked="1"]>.composer,
html[data-social-app="imessage"] .imessage-view[data-im135-blocked="1"]>.composer{
  display:none!important;
}
html[data-social-app="imessage"] .imessage-v19[data-im135-blocked="1"] .imessage-scroll-v19,
html[data-social-app="imessage"] .imessage-v19[data-im135-blocked="1"] #cv-scroll,
html[data-social-app="imessage"] .imessage-view[data-im135-blocked="1"] #cv-scroll{
  bottom:8px!important;
  padding-bottom:8px!important;
  scroll-padding-bottom:8px!important;
}

/* Forbidden marker before the DM display name. */
html[data-social-app="imessage"] .im135-blocked-icon{
  display:inline-flex!important;
  width:18px!important;
  height:18px!important;
  flex:0 0 18px!important;
  align-items:center!important;
  justify-content:center!important;
  margin-right:5px!important;
  color:#ff6b6b!important;
  vertical-align:-3px!important;
}
html[data-social-app="imessage"] .im135-blocked-icon svg{
  width:18px!important;
  height:18px!important;
  display:block!important;
  overflow:visible!important;
}
html[data-social-app="imessage"] .im-profile-name:has(.im135-blocked-icon),
html[data-social-app="imessage"] .im19-person>span:has(.im135-blocked-icon),
html[data-social-app="imessage"] .im-profile-title:has(.im135-blocked-icon){
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
}

/* Group sender display name = EXACTLY the same computed type size as the
   iMessage date/timestamp separator. Use one shared variable so older, more
   specific group rules cannot shrink the sender label back to 12.5px. */
html[data-social-app="imessage"]{
  --im135-meta-size:calc(13px * var(--yappy-font-scale,1));
}
html[data-social-app="imessage"] .im-date,
html[data-social-app="imessage"] .im26-group-room .im-msg-row.im26-group-in .im-sender{
  font-size:var(--im135-meta-size)!important;
  line-height:16px!important;
}
html[data-yappy-scale][data-social-app="imessage"] .im-date,
html[data-yappy-scale][data-social-app="imessage"] .im26-group-room .im-msg-row.im26-group-in .im-sender{
  font-size:var(--im135-meta-size)!important;
}

/* Wallpaper metadata shadow: softer than the previous WA-media strength, while
   still readable on busy/light photos. Bubble body text is intentionally untouched. */
html[data-social-app="imessage"] .imessage-v19.im62-has-wallpaper .im-receipt,
html[data-social-app="imessage"] .imessage-v19.im62-has-wallpaper .im-date,
html[data-social-app="imessage"] .imessage-v19.im62-has-wallpaper .im-system,
html[data-social-app="imessage"] .imessage-v19.im62-has-wallpaper .yx36-im-unsent,
html[data-social-app="imessage"] .imessage-v19.im62-has-wallpaper .im-sender,
html[data-theme="dark"][data-social-app="imessage"] .imessage-v19.im62-has-wallpaper .im-receipt,
html[data-theme="dark"][data-social-app="imessage"] .imessage-v19.im62-has-wallpaper .im-date,
html[data-theme="dark"][data-social-app="imessage"] .imessage-v19.im62-has-wallpaper .im-system,
html[data-theme="dark"][data-social-app="imessage"] .imessage-v19.im62-has-wallpaper .yx36-im-unsent,
html[data-theme="dark"][data-social-app="imessage"] .imessage-v19.im62-has-wallpaper .im-sender{
  color:#fff!important;
  text-shadow:0 1px 2px rgba(0,0,0,.44),0 0 1px rgba(0,0,0,.16)!important;
}

/* Screenshot renderer parity. */
.imx-root.imx-blocked .imx-composer{
  display:none!important;
}
.imx-root.imx-blocked .imx-message-viewport{
  bottom:8px!important;
}
.imx-blocked-icon{
  display:inline-flex;
  width:18px;
  height:18px;
  margin-right:5px;
  color:#ff6b6b;
  vertical-align:-3px;
}
.imx-blocked-icon svg{width:18px;height:18px;display:block}
.imx-profile-title:has(.imx-blocked-icon){
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
}
.imx-date,
.imx-sender{
  font-size:13px!important;
  line-height:16px!important;
}
.imx-root.imx-has-wallpaper .imx-receipt,
.imx-root.imx-has-wallpaper .imx-date,
.imx-root.imx-has-wallpaper .imx-system,
.imx-root.imx-has-wallpaper .imx-unsent,
.imx-root.imx-has-wallpaper .imx-sender{
  color:#fff!important;
  text-shadow:0 1px 2px rgba(0,0,0,.44),0 0 1px rgba(0,0,0,.16)!important;
}


/* v136 — let long iMessage group names use the full safe center column.
   The pill still hugs short names, but can grow until the inner boundaries of
   Back and FaceTime. Only after that point does the text ellipsize. */
html[data-social-app="imessage"] .im26-group-room .im19-person.im26-group-person{
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
}
html[data-social-app="imessage"] .im26-group-room
.im19-person.im26-group-person>.im26-group-title{
  width:fit-content!important;
  max-width:100%!important;
  min-width:76px!important;
  align-self:center!important;
  box-sizing:border-box!important;
}
html[data-social-app="imessage"] .im26-group-room .im26-group-title-text{
  flex:1 1 auto!important;
  min-width:0!important;
  max-width:none!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  white-space:nowrap!important;
}

/* Older <=390px rules capped the pill back to 170px/137px. Keep the same
   responsive safe-column behavior on small devices too. */
@media(max-width:390px){
  html[data-social-app="imessage"] .im26-group-room
  .im19-person.im26-group-person>.im26-group-title{
    max-width:100%!important;
  }
  html[data-social-app="imessage"] .im26-group-room .im26-group-title-text{
    max-width:none!important;
  }
}

/* Dedicated iMessage screenshot renderer mirrors the same center-column limit. */
.imx-root .imx-profile{
  min-width:0!important;
}
.imx-root .imx-group-title{
  width:fit-content!important;
  max-width:100%!important;
  min-width:76px!important;
  box-sizing:border-box!important;
  overflow:hidden!important;
}
