.s-messages-sender {
	color: #333;
	font-weight: 700;
	text-transform: capitalize;
	font-size: 1.1rem;
	/*vertical-align: middle;*/
}

.s-messages-content {
	word-break: break-all;
}

.s-messages-item {
	/*margin: 0 0 .5rem 0;*/
}

.s-messages-item-replies .s-messages-item {
	margin: 0 0 0 3.2rem;
}

/*! Custom Scrollbar */
/* width */
::-webkit-scrollbar {
	width: 10px;
}

/* Track */
::-webkit-scrollbar-track {
	background-color: #fff;
}

/* Handle */
::-webkit-scrollbar-thumb {
	background-color: #D6D4D4;
	border-radius: 10px;
}

/* Handle on hover */
::-webkit-scrollbar-thumb:hover {
	cursor: pointer;
}

.list-group-item.active.s-active {
	color: #323232;
	background-color: #E0F0FA;
}

.list-group-item:hover {
	cursor: pointer;
	background-color: #E0F0FA;
}

.vh-78 {
	height: 78vh !important;
}

.bottom-0 {
	bottom: 0px;
}

#s-messages .s-overflow-container:first-child {
	height: auto;
	margin-bottom: 1.5rem;
	max-height: 80vh;
}

#s-messages .s-overflow-container:last-child {
	height: 80vh;
	/*overflow-y: auto !important;*/
}

@media (min-width: 992px) {
	#s-messages .s-overflow-container:first-child {
		height: 80vh;
		border-right: 0 !important;
	}
}

.widgetBody #s-messages .s-overflow-y {
	max-height: none;
}

.widgetBody #s-messages .messages-header {
	display: none;
}

.widgetBody #s-messages .d-flex-widget {
	display: flex;
	align-items: center;
}

.s-choose-message-container {
	/* height: 78vh !important;*/
	position: absolute;
	left: 0;
	top: 0;
	width: 100%;
	height: 100%;
	overflow-y: auto;
	background-color: #F5F5F5;
	padding: 1rem;
}

.s-choose-message-container img {
	max-width: 90%;
	height: auto;
}

.s-widget-messages-container .s-choose-message-container {
	top: 50px;
	height: calc(100% - 50px);
}

.s-widget-messages-container .s-choose-message-container img {
	width: 55%;
}

/* The action buttons stay in normal flow so they define the group's single-row
   height and remain pinned to the top-right, no matter how tall the textarea grows. */
.s-messages-input-group {
	position: relative;
	justify-content: flex-end;
}

.s-messages-input-group .input-group-append {
	/* positioned + lifted so the buttons paint above (and stay clickable over) the
	   absolutely-positioned textarea that spans the full width beneath them. */
	position: relative;
	z-index: 6;
}

.s-messages-list-input {
	/*position: sticky;*/
	/*bottom: 8.3%;*/
	bottom: -1px;
	width: 100%;
	/*width: 63.5vw;*/
	background-color: #fff;
	/*border-bottom: 1px solid #ced4da;*/
	/*z-index: 3;*/
}

/* The textarea is taken out of flow so its height no longer stretches the input
   group (and therefore no longer stretches the buttons). It grows downward; the
   max-height caps it at ~6 rows, after which the JS switches it to internal scroll.
   min-height / max-height are the single source of truth for the row thresholds —
   the controller reads these computed values rather than duplicating the numbers. */

.s-messages-list-input.form-control {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	/* override Bootstrap's `.input-group > .form-control { width: 1% }` so the box width
	   is driven by left/right (parent width minus the buttons), not an explicit width. */
	width: auto;
	z-index: 1;
	min-height: calc(1.5em + 0.75rem + 2px);
	max-height: calc(6 * 1.5em + 0.75rem + 2px);
	overflow-y: hidden;
	resize: none;
	background-color: #fff;
}

/* Once the text wraps to 2+ rows the textarea lifts into a floating panel so the
   overflowing rows read clearly over whatever sits below the input group. */
.s-messages-list-input.s-messages-text-input-floating {
	z-index: 5;
	border: 1px solid #ced4da;
	border-radius: 0.25rem;
	box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.15);
}

/* When the input loses focus, a multi-line draft collapses to a single truncated row.
   A textarea can't render text-overflow:ellipsis, so this <div> overlay stands in while
   the input is blurred and is swapped back for the live textarea on focus. */
.s-messages-text-input-preview.form-control {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	width: auto; /* defeat Bootstrap's `.input-group > .form-control { width: 1% }` */
	z-index: 2;  /* above the textarea, below the action buttons */
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
	background-color: #fff;
	cursor: text;
	/* purely visual overlay — clicks/focus fall through to the textarea underneath, so the
	   real (focusable) textarea stays reachable by Tab / Shift-Tab and by clicking. */
	pointer-events: none;
}

/* Solid "characters left" counter just below the textarea, right-aligned. Its top/right are
   set inline by the controller so it tracks the textarea's current height. */
.s-messages-char-counter {
	position: absolute;
	z-index: 6; /* above the floating textarea, alongside the buttons (sits to their left) */
	padding: 0 0.2rem;
	font-size: 0.75rem;
	line-height: 1.2;
	color: var(--white);
	background-color: var(--gray);
	pointer-events: none;
}

/*
@media screen and (max-width: 991px){
    .s-messages-list-input{
        width: 90vw;
    }
}

@media screen and (max-width: 550px){
    .s-messages-list-input{
        width: 84vw;
    }
}
*/

@media (max-width: 575px) {
	.fa-user-circle.fa-4x {
		font-size: 3em;
	}
}

.fa-user-circle:before {
	color: #CAC7C7;
}

.s-messages-unviewed-item {
	padding: 0;
	margin: 0.8rem 0rem;
	background-color: #E13F61;
	border: 1px solid #E13F61;
	width: 50%;
	float: left;
}

.s-pill-unviewed-container {
	top: -8px;
	margin: 0 auto;
	left: 0;
	right: 0;
	width: 100px;
	z-index: 2;
}

.s-pill-unviewed {
	color: #E13F61;
	border-color: #E13F61;
}

.s-date-thread {
	height: 40px;
	margin-top: 0.5rem;
	margin-bottom: 0.5rem;
	color: #CAC7C7;
}

.s-user-icon {
	font-size: 22px;
}

.s-pill-unviewed-messages {
	color: #E13F61;
	border-color: #E13F61;
	z-index: 2;
	position: absolute;
	margin: 5px auto 0 auto;
	width: 140px;
	left: 0;
	right: 0;
}

.s-btn-unviewed-messages {
	color: #fff;
	width: 137px;
	display: block;
	font-size: .7rem;
	font-weight: normal;
	position: absolute;
	left: 0;
	right: 0;
	margin: 0 auto;
	z-index: 2;
	top: 14px;
}

#messagesListContainer {
	overflow-y: auto;
	scroll-behavior: smooth;
}

#messagesListContainer ul {
	margin-bottom: 0;
}

.s-pill-members {
	background-color: #E0F0FA;
	border-color: transparent;
	padding: 0.5rem 0.8rem;
	font-weight: normal;
}

.s-messages-chat-content {
	/* height: 61vh; */
	position: absolute;
	left: 0;
	top: 0;
	width: 100%;
	height: 100%;
}

.s-messages-item-selected {
	background-color: #F0EEF0;
	/*padding: 9px;*/
	border-radius: 6px;
}

.s-messages-actions {
	top: -30px;
	right: 8px;
}

.s-bottom-0 {
	bottom: 0;
}

.s-right-0 {
	right: 45px;
}

.s-messages-button {
	z-index: 4;
}

.s-w-85 {
	width: 85%;
}

.s-icon-custom {
	height: 2em;
	width: 2em;
	display: flex !important;
	align-items: center;
	justify-content: center;
	font-size: 1.6em;
}

@media (min-width: 576px) {
	.s-icon-custom {
		font-size: 2em;
	}
}

.widgetBody .list-group-item {
	padding-left: 0;
	padding-right: 0;
}

.s-overflow-y {
	overflow-y: auto;
}

.s-overflow-x-hidden {
	overflow-x: hidden;
}

.widgetBody .s-text-truncate-sm {
	width: 75%;
}

.s-horizontal-line {
	display: -webkit-box;
	display: -ms-flexbox;
	display: flex;
	height: 40px;
	-webkit-box-pack: center;
	-ms-flex-pack: center;
	justify-content: center;
	position: absolute;
	width: 100%;
}

.s-horizontal-line::before, .s-horizontal-line::after {
	background-color: #dbdce0;
	content: "";
	height: 1px;
	top: 50%;
	position: absolute;
	width: calc(50% - 83px);
}

.s-horizontal-line::before {
	left: 0;
}

.s-horizontal-line::after {
	right: 0;
}

.widgetBody #simplica_messages_MessagesWidgetCtrl {
	overflow-y: hidden;
}

.s-messages-image {
	max-width: 100%;
	max-height: 200px;
	height: auto;
	width: auto;
}

.messages-list-outer {
	position: absolute;
	left: 0;
	top: 0;
	width: 100%;
	height: 100%;
}

@media (max-width: 575px) {
	.btn-new-message {
		padding-top: 0.3rem;
		padding-bottom: 0.3rem;
	}
}

.messages-header {
	box-shadow: 0 0 5px 0 rgba(0, 0, 0, 0.1);
}

.s-messages-line-item {
	padding: 0.75rem;
	display: flex;
	max-width: 100%;
	position: relative;
}

.s-messages-line-user-icon {
	flex: 0 0 2.5rem;
}

.s-messages-line-message {
	padding-left: 0.5rem;
}

.s-messages-item-reply {
	flex: 0 0 100%;
	padding: 0 0.75rem 0.75rem;
}

.text-pre {
    white-space: pre-wrap;
}

s-message-content {
	overflow-wrap: anywhere;
	white-space: pre-wrap;
	word-break: break-word;
}