html,body{max-width:100%;overflow-x:hidden}
.layout,.workspace,.main,.chat,.sidebar{min-width:0}
.modal-back{max-width:100vw;max-height:100dvh;overflow:auto}
.modal,.ss-modal{max-width:calc(100vw - 16px);max-height:calc(100dvh - 16px)}
.profile,.cax-profile{max-width:calc(100vw - 16px);max-height:calc(100dvh - 16px);overflow-y:auto}
.toast{max-width:calc(100vw - 30px)}
.cax-reaction-picker,#caxContext{max-width:calc(100vw - 16px);max-height:calc(100dvh - 16px);overscroll-behavior:contain}
@media(max-width:600px){.ss-modal{max-width:100vw;max-height:100dvh}.modal-back{padding:8px}.modal{max-width:100%}}

/* Center Latin-letter fallback avatars consistently across Cax. */
.avatar:not(img),
.cax-decor-avatar > .avatar:not(img),
.cax-presence-avatar > .avatar:not(img),
.cax-profile-actions .avatar:not(img),
.profile .avatar:not(img),
.member .avatar:not(img),
.message .avatar:not(img) {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  line-height: 1 !important;
  padding: 0 !important;
  box-sizing: border-box;
  background-position: center center;
  background-repeat: no-repeat;
}
/* Preserve the round avatar shape and decoration overlay. */
.avatar:not(img) { border-radius: 50%; }

/* Member list: center fallback initials in the avatar circle, including
   users with decorations and presence indicators. */
.memberlist .cax-presence-avatar,
.memberlist .cax-decorated-avatar {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  position: relative;
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  vertical-align: middle;
}
.memberlist .cax-presence-avatar > .avatar:not(img),
.memberlist .cax-decorated-avatar > .avatar:not(img),
.memberlist .avatar:not(img) {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  flex: 0 0 32px;
  margin: 0 !important;
  padding: 0 !important;
  line-height: 1 !important;
  text-align: center !important;
  border-radius: 50%;
}
