/* =========================================================================
   SC Portal — Support Messenger (WhatsApp-style)
   Scoped under .sc-wa so it cleanly overrides the older ticket styles.
   ========================================================================= */

.sc-wa {
	--wa-app:      #0e1a21;
	--wa-panel:    #16242d;
	--wa-head:     #1e323d;
	--wa-hover:    #21343f;
	--wa-active:   #2b4653;
	--wa-line:     #2a3f4b;
	--wa-txt:      #f1f6f8;
	--wa-dim:      #9db0bb;
	--wa-green:    #17b899;
	--wa-teal:     #2393a2;
	--wa-out:      #0a6f5c;
	--wa-in:       #22343e;
	--wa-input:    #2b414d;

	display: flex;
	width: 100%;
	height: min(calc(100vh - 150px), 820px);
	min-height: 540px;
	background: var(--wa-app);
	color: var(--wa-txt);
	border: 1px solid var(--wa-line);
	border-radius: 12px;
	overflow: hidden;
	font-family: "Segoe UI", Inter, Quicksand, system-ui, -apple-system, sans-serif;
	font-size: 14.5px;
	line-height: 1.45;
	box-shadow: 0 18px 48px rgba(0, 0, 0, .45);
}

.sc-wa *,
.sc-wa *::before,
.sc-wa *::after { box-sizing: border-box; }

.sc-wa p { margin: 0; }

.sc-wa-ico { flex: 0 0 auto; display: block; }

.sc-wa-iconbtn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--wa-dim);
	cursor: pointer;
	transition: background .15s ease, color .15s ease;
}
.sc-wa-iconbtn:hover { background: rgba(255, 255, 255, .07); color: var(--wa-txt); }

/* ---------------------------------------------------------- LEFT LIST -- */

.sc-wa-list {
	flex: 0 0 34%;
	min-width: 290px;
	max-width: 430px;
	display: flex;
	flex-direction: column;
	background: var(--wa-panel);
	border-right: 1px solid var(--wa-line);
}

.sc-wa-listhead {
	display: flex;
	align-items: center;
	gap: 10px;
	height: 60px;
	padding: 0 10px 0 16px;
	background: var(--wa-head);
	flex: 0 0 auto;
}
.sc-wa-me { display: flex; }
.sc-wa-me .sc-wa-me-img,
.sc-wa-me img { width: 38px; height: 38px; border-radius: 50%; display: block; }
.sc-wa-brand { flex: 1 1 auto; font-size: 15px; font-weight: 600; letter-spacing: .2px; }

.sc-wa-searchbar {
	position: relative;
	flex: 0 0 auto;
	padding: 8px 12px;
	background: var(--wa-panel);
}
.sc-wa-searchico {
	position: absolute;
	left: 26px;
	top: 50%;
	transform: translateY(-50%);
	color: var(--wa-dim);
	pointer-events: none;
}
.sc-wa-searchbar input {
	width: 100%;
	height: 36px;
	margin: 0;
	padding: 0 14px 0 42px;
	border: 0;
	border-radius: 8px;
	background: var(--wa-input);
	color: var(--wa-txt);
	font-size: 14px;
	outline: none;
	box-shadow: none;
}
.sc-wa-searchbar input::placeholder { color: var(--wa-dim); }

.sc-wa-chips {
	display: flex;
	gap: 7px;
	padding: 2px 12px 10px;
	flex: 0 0 auto;
	flex-wrap: wrap;
}
.sc-wa-chip {
	padding: 4px 12px;
	border: 0;
	border-radius: 999px;
	background: var(--wa-input);
	color: var(--wa-dim);
	font-size: 12.5px;
	cursor: pointer;
	transition: background .15s ease, color .15s ease;
}
.sc-wa-chip:hover { color: var(--wa-txt); }
.sc-wa-chip.active { background: rgba(0, 168, 132, .22); color: #7ae3c3; }

.sc-wa-items {
	flex: 1 1 auto;
	overflow-y: auto;
}

.sc-wa-item {
	display: flex;
	align-items: center;
	gap: 13px;
	padding: 11px 14px;
	border-bottom: 1px solid var(--wa-line);
	text-decoration: none;
	color: inherit;
	cursor: pointer;
	transition: background .12s ease;
}
.sc-wa-item:hover { background: var(--wa-hover); text-decoration: none; color: inherit; }
.sc-wa-item.active { background: var(--wa-active); }

.sc-wa-avatar {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: 42px;
	height: 42px;
	border-radius: 50%;
	background: #364147;
	color: #aebac1;
}

.sc-wa-item-body { flex: 1 1 auto; min-width: 0; display: block; }
.sc-wa-item-r1,
.sc-wa-item-r2 {
	display: flex;
	align-items: center;
	gap: 8px;
	justify-content: space-between;
}
.sc-wa-item-r2 { margin-top: 3px; }

.sc-wa-item-name {
	flex: 1 1 auto;
	min-width: 0;
	font-size: 15px;
	font-weight: 500;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.sc-wa-item-time { flex: 0 0 auto; font-size: 11.5px; color: var(--wa-dim); }
.sc-wa-item-snip {
	flex: 1 1 auto;
	min-width: 0;
	font-size: 13px;
	color: var(--wa-dim);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.sc-wa-dot {
	flex: 0 0 auto;
	min-width: 19px;
	height: 19px;
	padding: 0 5px;
	border-radius: 999px;
	background: var(--wa-green);
	color: #0b141a;
	font-size: 11px;
	font-weight: 700;
	line-height: 19px;
	text-align: center;
}
.sc-wa-pill {
	flex: 0 0 auto;
	padding: 1px 8px;
	border-radius: 999px;
	background: rgba(134, 150, 160, .18);
	color: var(--wa-dim);
	font-size: 10.5px;
	text-transform: uppercase;
	letter-spacing: .5px;
}

.sc-wa-nolist {
	padding: 46px 26px;
	text-align: center;
	color: var(--wa-dim);
}
.sc-wa-nolist .sc-wa-ico { margin: 0 auto 12px; }
.sc-wa-nolist p { font-size: 13.5px; }

/* --------------------------------------------------------- RIGHT PANE -- */

.sc-wa-chat {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	flex-direction: column;
	position: relative;
	background-color: var(--wa-app);
	background-image:
		radial-gradient(rgba(255, 255, 255, .022) 1px, transparent 1px),
		radial-gradient(rgba(255, 255, 255, .022) 1px, transparent 1px);
	background-size: 34px 34px, 34px 34px;
	background-position: 0 0, 17px 17px;
}

.sc-wa-thread {
	display: flex;
	flex-direction: column;
	height: 100%;
	min-height: 0;
}

.sc-wa-chathead {
	display: flex;
	align-items: center;
	gap: 12px;
	flex: 0 0 auto;
	height: 60px;
	padding: 0 14px;
	background: var(--wa-head);
	border-bottom: 1px solid var(--wa-line);
}
.sc-wa-chathead .sc-wa-back { display: none; }
.sc-wa-chathead-txt { min-width: 0; }
.sc-wa-chathead-txt h3 {
	margin: 0;
	font-size: 15.5px;
	font-weight: 600;
	color: var(--wa-txt);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	line-height: 1.25;
}
.sc-wa-sub { display: block; font-size: 12px; color: var(--wa-dim); }
.sc-wa-status { font-style: normal; text-transform: capitalize; }
.sc-wa-status-open { color: #7ae3c3; }
.sc-wa-status-replied { color: #f5c451; }
.sc-wa-status-closed { color: #8696a0; }

/* messages */

.sc-wa-msgs {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	padding: 18px 6% 14px;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.sc-wa-daysep { align-self: center; margin: 10px 0 6px; }
.sc-wa-daysep span {
	display: inline-block;
	padding: 4px 12px;
	border-radius: 8px;
	background: rgba(32, 44, 51, .92);
	color: var(--wa-dim);
	font-size: 11.5px;
	text-transform: uppercase;
	letter-spacing: .5px;
}

.sc-wa-row { display: flex; max-width: 100%; }
.sc-wa-row.in { justify-content: flex-start; }
.sc-wa-row.out { justify-content: flex-end; }

.sc-wa-bubble {
	position: relative;
	max-width: 74%;
	padding: 7px 11px 6px;
	border-radius: 9px;
	background: var(--wa-in);
	box-shadow: 0 1px 1px rgba(0, 0, 0, .28);
	word-wrap: break-word;
	overflow-wrap: anywhere;
}
.sc-wa-row.out .sc-wa-bubble { background: var(--wa-out); border-top-right-radius: 2px; }
.sc-wa-row.in  .sc-wa-bubble { border-top-left-radius: 2px; }

.sc-wa-who {
	display: block;
	margin-bottom: 2px;
	font-size: 12px;
	font-weight: 600;
	color: #53bdeb;
}
.sc-wa-row.out .sc-wa-who { color: #7ae3c3; }

.sc-wa-text { font-size: 14.2px; color: var(--wa-txt); white-space: normal; }

.sc-wa-time {
	display: block;
	margin-top: 3px;
	text-align: right;
	font-size: 11px;
	color: rgba(233, 237, 239, .5);
}

.sc-wa-file {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin-top: 7px;
	padding: 6px 10px;
	border-radius: 7px;
	background: rgba(0, 0, 0, .22);
	color: var(--wa-txt);
	font-size: 12.5px;
	text-decoration: none;
}
.sc-wa-file:hover { background: rgba(0, 0, 0, .34); color: #fff; text-decoration: none; }

.sc-wa-nomsg {
	margin: auto;
	color: var(--wa-dim);
	font-size: 13.5px;
	text-align: center;
}

/* composer */

.sc-wa-footer { flex: 0 0 auto; background: var(--wa-head); padding: 8px 14px; }

.sc-wa-composer {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0;
}
.sc-wa-cbtn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: 42px;
	height: 42px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--wa-dim);
	cursor: pointer;
	transition: background .15s ease, color .15s ease;
}
.sc-wa-cbtn:hover { background: rgba(255, 255, 255, .07); color: var(--wa-txt); }
.sc-wa-attach input[type="file"] { display: none; }

.sc-wa-send { background: var(--wa-green); color: #0b141a; }
.sc-wa-send:hover { background: #06c39a; color: #0b141a; }
.sc-wa-send[disabled] { opacity: .55; cursor: default; }

.sc-wa-inputwrap {
	flex: 1 1 auto;
	min-width: 0;
	position: relative;
	background: var(--wa-input);
	border-radius: 10px;
	padding: 6px 12px;
}
.sc-wa-input {
	width: 100%;
	max-height: 140px;
	min-height: 30px;
	margin: 0;
	padding: 3px 0;
	border: 0;
	background: transparent;
	color: var(--wa-txt);
	font: inherit;
	font-size: 14.2px;
	line-height: 1.5;
	resize: none;
	outline: none;
	box-shadow: none;
	overflow-y: auto;
}
.sc-wa-input::placeholder { color: var(--wa-dim); }
.sc-wa-filename {
	display: none;
	padding-top: 2px;
	font-size: 11.5px;
	color: #7ae3c3;
}
.sc-wa-filename.on { display: block; }

/* closed / ended chat notice — replaces the composer in place */
.sc-wa-locked {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 9px;
	padding: 15px 18px;
	border-radius: 10px;
	background: rgba(11, 20, 26, .75);
	border: 1px solid var(--wa-line);
	color: var(--wa-dim);
	font-size: 13.2px;
	text-align: center;
}

.sc-wa-flash {
	margin: 0 0 8px;
	padding: 8px 12px;
	border-radius: 8px;
	background: rgba(220, 38, 38, .16);
	color: #fca5a5;
	font-size: 12.8px;
}
.sc-wa-flash.ok { background: rgba(0, 168, 132, .16); color: #7ae3c3; }

/* empty state */

.sc-wa-empty {
	margin: auto;
	max-width: 480px;
	padding: 30px;
	text-align: center;
	color: var(--wa-dim);
}
.sc-wa-empty-art {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 112px;
	height: 112px;
	margin-bottom: 22px;
	border-radius: 50%;
	background: rgba(255, 255, 255, .03);
	color: #3b4a54;
}
.sc-wa-empty h2 {
	margin: 0 0 12px;
	font-size: 27px;
	font-weight: 300;
	color: #e9edef;
	letter-spacing: .2px;
}
.sc-wa-empty p { font-size: 13.8px; line-height: 1.65; }
.sc-wa-empty-foot {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin-top: 26px;
	padding-top: 18px;
	border-top: 1px solid var(--wa-line);
	font-size: 12.2px;
}

/* ------------------------------------------------------------- MODAL -- */

.sc-wa-modal {
	display: none;
	position: fixed;
	inset: 0;
	z-index: 99999;
	background: rgba(0, 0, 0, .68);
	padding: 24px;
	overflow-y: auto;
}
.sc-wa-modal.open { display: flex; align-items: center; justify-content: center; }

.sc-wa-modal-card {
	width: 100%;
	max-width: 520px;
	background: #111b21;
	border: 1px solid #222d34;
	border-radius: 12px;
	overflow: hidden;
	color: #e9edef;
	box-shadow: 0 24px 60px rgba(0, 0, 0, .55);
	font-family: "Segoe UI", Inter, Quicksand, system-ui, sans-serif;
}
.sc-wa-modal-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 12px 14px 20px;
	background: #202c33;
}
.sc-wa-modal-head h3 { margin: 0; font-size: 16px; font-weight: 600; }
.sc-wa-modal-body { padding: 20px; }

.sc-wa-field { margin-bottom: 15px; }
.sc-wa-field label {
	display: block;
	margin-bottom: 6px;
	font-size: 12.5px;
	color: #8696a0;
	text-transform: uppercase;
	letter-spacing: .5px;
}
.sc-wa-text,
.sc-wa-area,
.sc-wa-select,
.sc-wa-file-input {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid #2a3942;
	border-radius: 8px;
	background: #2a3942;
	color: #e9edef;
	font: inherit;
	font-size: 14px;
	outline: none;
}
.sc-wa-area { resize: vertical; min-height: 96px; }
.sc-wa-text:focus,
.sc-wa-area:focus,
.sc-wa-select:focus { border-color: #00a884; }

.sc-wa-modal-foot {
	display: flex;
	justify-content: flex-end;
	gap: 10px;
	padding-top: 6px;
}
.sc-wa-btn {
	padding: 9px 20px;
	border: 0;
	border-radius: 8px;
	font: inherit;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
}
.sc-wa-btn.primary { background: #00a884; color: #0b141a; }
.sc-wa-btn.primary:hover { background: #06c39a; }
.sc-wa-btn.ghost { background: transparent; color: #8696a0; }
.sc-wa-btn.ghost:hover { color: #e9edef; }
.sc-wa-btn[disabled] { opacity: .6; cursor: default; }

/* scrollbars */
.sc-wa-items::-webkit-scrollbar,
.sc-wa-msgs::-webkit-scrollbar { width: 7px; }
.sc-wa-items::-webkit-scrollbar-thumb,
.sc-wa-msgs::-webkit-scrollbar-thumb { background: #374248; border-radius: 4px; }
.sc-wa-items::-webkit-scrollbar-track,
.sc-wa-msgs::-webkit-scrollbar-track { background: transparent; }

/* ------------------------------------------------------------ MOBILE -- */

@media (max-width: 820px) {
	.sc-wa {
		height: calc(100vh - 120px);
		min-height: 520px;
		border-radius: 0;
		border-left: 0;
		border-right: 0;
	}
	.sc-wa-list {
		flex: 1 1 100%;
		max-width: none;
		min-width: 0;
		border-right: 0;
	}
	.sc-wa-chat { display: none; }

	.sc-wa.has-active .sc-wa-list { display: none; }
	.sc-wa.has-active .sc-wa-chat { display: flex; flex: 1 1 100%; }

	.sc-wa-chathead .sc-wa-back { display: inline-flex; }
	.sc-wa-msgs { padding: 14px 12px; }
	.sc-wa-bubble { max-width: 86%; }
}


/* =========================================================================
   Layout width, contrast pass and admin conversation view
   ========================================================================= */

/* Break out of the theme's narrow content column. */
.sc-wa-wrapper {
	position: relative;
	left: 50%;
	transform: translateX(-50%);
	width: min(1760px, 95vw);
	max-width: 95vw;
	margin: 26px 0 34px;
	padding: 0;
}

/* The theme styles generic tags inside content; neutralise that here so the
   bubbles and rows render exactly as designed. */
.sc-wa p,
.sc-wa span,
.sc-wa h2,
.sc-wa h3,
.sc-wa a,
.sc-wa div {
	box-shadow: none;
	text-shadow: none;
}
.sc-wa p,
.sc-wa .sc-wa-text {
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	max-width: none;
}
.sc-wa a { box-shadow: none; }
.sc-wa a::after,
.sc-wa a::before { content: none; }
.sc-wa button { font-family: inherit; letter-spacing: normal; text-transform: none; }

/* Slightly livelier chrome. */
.sc-wa {
	border-color: rgba(35, 147, 162, .32);
	box-shadow: 0 22px 60px rgba(0, 0, 0, .5), 0 0 0 1px rgba(35, 147, 162, .08) inset;
}
.sc-wa-listhead,
.sc-wa-chathead {
	background: linear-gradient(180deg, #23414f 0%, #1e323d 100%);
	border-bottom: 1px solid rgba(35, 147, 162, .22);
}
.sc-wa-brand {
	font-size: 16px;
	color: #ffffff;
}
.sc-wa-chat {
	background-image:
		radial-gradient(rgba(35, 147, 162, .06) 1px, transparent 1px),
		radial-gradient(rgba(255, 255, 255, .03) 1px, transparent 1px);
}
.sc-wa-item.active {
	box-shadow: inset 3px 0 0 var(--wa-green);
}
.sc-wa-item-name { color: #ffffff; }
.sc-wa-chip.active { background: rgba(23, 184, 153, .26); color: #8ff0d7; }
.sc-wa-bubble { box-shadow: 0 2px 6px rgba(0, 0, 0, .32); }
.sc-wa-row.out .sc-wa-bubble { background: linear-gradient(180deg, #0d7f69 0%, #0a6f5c 100%); }
.sc-wa-row.in .sc-wa-bubble { background: linear-gradient(180deg, #263b46 0%, #22343e 100%); }
.sc-wa-text { color: #f4f8fa; }
.sc-wa-time { color: rgba(241, 246, 248, .62); }
.sc-wa-empty h2 { color: #ffffff; font-weight: 400; }
.sc-wa-empty-art { color: var(--wa-teal); background: rgba(35, 147, 162, .09); }

/* Send button: perfectly centred with the input row. */
.sc-wa-footer {
	padding: 10px 16px;
	border-top: 1px solid rgba(35, 147, 162, .18);
}
.sc-wa-composer .sc-wa-cbtn {
	align-self: center;
	width: 44px;
	height: 44px;
	line-height: 0;
}
.sc-wa-composer .sc-wa-send {
	background: var(--wa-green);
	color: #06231d;
	box-shadow: 0 3px 10px rgba(23, 184, 153, .32);
}
.sc-wa-composer .sc-wa-send:hover { background: #21d1af; color: #06231d; }
.sc-wa-composer .sc-wa-send .sc-wa-ico { margin: 0; position: relative; left: -1px; }
.sc-wa-inputwrap {
	display: flex;
	flex-direction: column;
	justify-content: center;
	min-height: 44px;
	padding: 7px 14px;
	border: 1px solid transparent;
	transition: border-color .15s ease;
}
.sc-wa-inputwrap:focus-within { border-color: rgba(23, 184, 153, .45); }

/* Support avatar images. */
.sc-wa-avatar {
	overflow: hidden;
	background: #2b414d;
	color: #bcd0da;
	font-weight: 600;
	font-size: 15px;
}
.sc-wa-avatar img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	border-radius: 50%;
	margin: 0;
	max-width: none;
}
.sc-wa-avatar.has-img { background: transparent; }
.sc-wa-me { flex: 0 0 auto; }
.sc-wa-avatar-initial {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	border-radius: 50%;
	background: var(--wa-teal);
	color: #06231d;
	font-weight: 700;
}

/* ------------------------------------------------- WP-Admin conversation -- */

.sc-wa-adminwrap { max-width: 1180px; }

.sc-wa-admin {
	height: min(calc(100vh - 220px), 760px);
	min-height: 480px;
	border-radius: 10px;
}
.sc-wa-admin .sc-wa-chat { flex: 1 1 100%; }
.sc-wa-admin .sc-wa-chathead { padding-right: 10px; }
.sc-wa-admin .sc-wa-chathead-txt { flex: 1 1 auto; min-width: 0; }
.sc-wa-admin .sc-wa-back { display: none; }
.sc-wa-admin .sc-wa-input { min-height: 26px; }
.sc-wa-admin .sc-wa-msgs { padding: 18px 4%; }

.sc-wa-headactions {
	display: flex;
	align-items: center;
	gap: 8px;
	flex: 0 0 auto;
}
.sc-wa-btn.danger { background: #b91c1c; color: #fff; }
.sc-wa-btn.danger:hover { background: #d12626; }
.sc-wa .sc-wa-btn.ghost {
	border: 1px solid rgba(255, 255, 255, .18);
	color: #dbe6ec;
	padding: 7px 14px;
	font-size: 13px;
}
.sc-wa .sc-wa-btn.ghost:hover { border-color: var(--wa-green); color: #8ff0d7; }

@media (max-width: 820px) {
	.sc-wa-wrapper {
		width: 100vw;
		max-width: 100vw;
		margin: 12px 0 20px;
	}
	.sc-wa { height: calc(100vh - 110px); }
}


/* Send button as a labelled pill — reliably aligned with the input row. */
.sc-wa-composer .sc-wa-send,
.sc-wa .sc-wa-send {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	align-self: center;
	width: auto;
	min-width: 88px;
	height: 44px;
	padding: 0 22px;
	border: 0;
	border-radius: 22px;
	background: var(--wa-green);
	color: #06231d;
	font-family: inherit;
	font-size: 14.5px;
	font-weight: 700;
	letter-spacing: .3px;
	line-height: 1;
	cursor: pointer;
	transition: background .15s ease, transform .08s ease;
	box-shadow: 0 3px 12px rgba(23, 184, 153, .3);
}
.sc-wa-composer .sc-wa-send:hover,
.sc-wa .sc-wa-send:hover { background: #21d1af; color: #06231d; }
.sc-wa-composer .sc-wa-send:active { transform: translateY(1px); }
.sc-wa-composer .sc-wa-send[disabled] { opacity: .55; cursor: default; box-shadow: none; }
