/**
 * WP Private Message – Paktograf 1.2.2 compatibility shield.
 *
 * Some Paktograf theme builds still ship the original plugin stylesheet.
 * Those legacy rules add labels through pseudo-elements and style generic
 * .btn/.button classes, causing duplicate words and a clipped composer.
 * Everything here is scoped to the v2 inbox root.
 */

.box-dashboard-message.wppm-ui-v2 {
	isolation: isolate;
	position: relative;
}

/* Legacy theme CSS uses pseudo-elements for old labels such as
 * "Sve", "Pročitano", "Novo", "Obriši" and "Odaberite poruku".
 * The current markup contains real accessible text, so generated text must go.
 */
.box-dashboard-message.wppm-ui-v2 *::before,
.box-dashboard-message.wppm-ui-v2 *::after {
	content: none !important;
	display: none !important;
}

/* Keep the shell out of old float/width layouts. */
.box-dashboard-message.wppm-ui-v2 .message-section-wrapper {
	float: none !important;
	max-width: none !important;
	width: 100% !important;
}

.box-dashboard-message.wppm-ui-v2 .message-inner {
	display: grid !important;
	float: none !important;
	grid-template-columns: minmax(280px, 350px) minmax(0, 1fr) !important;
	max-width: none !important;
	width: 100% !important;
}

.box-dashboard-message.wppm-ui-v2 .list-message-wrapper,
.box-dashboard-message.wppm-ui-v2 .replies-content {
	float: none !important;
	max-width: none !important;
	min-width: 0 !important;
	position: relative !important;
	width: auto !important;
}

.box-dashboard-message.wppm-ui-v2 ul,
.box-dashboard-message.wppm-ui-v2 ol,
.box-dashboard-message.wppm-ui-v2 li {
	list-style: none !important;
}

/* Search and filters: no inherited theme labels or Bootstrap sizing. */
.box-dashboard-message.wppm-ui-v2 .search-message-form,
.box-dashboard-message.wppm-ui-v2 .search-wrapper-message,
.box-dashboard-message.wppm-ui-v2 .wppm-filter-options,
.box-dashboard-message.wppm-ui-v2 .wppm-filter-list {
	float: none !important;
	max-width: none !important;
	width: 100% !important;
}

.box-dashboard-message.wppm-ui-v2 .wppm-filter-list {
	display: flex !important;
	gap: 6px !important;
	margin: 0 !important;
	padding: 0 !important;
}

.box-dashboard-message.wppm-ui-v2 .wppm-filter-list > li {
	display: block !important;
	flex: 1 1 0 !important;
	margin: 0 !important;
	padding: 0 !important;
}

.box-dashboard-message.wppm-ui-v2 .wppm-filter-list input[type="radio"] {
	height: 1px !important;
	left: -9999px !important;
	opacity: 0 !important;
	position: absolute !important;
	width: 1px !important;
}

.box-dashboard-message.wppm-ui-v2 .wppm-filter-list label {
	align-items: center !important;
	background: transparent !important;
	border: 1px solid transparent !important;
	border-radius: 999px !important;
	box-shadow: none !important;
	color: var(--wppm-muted) !important;
	display: flex !important;
	font-size: 12px !important;
	font-weight: 700 !important;
	justify-content: center !important;
	letter-spacing: normal !important;
	line-height: 1 !important;
	margin: 0 !important;
	min-height: 32px !important;
	padding: 8px 8px !important;
	text-transform: none !important;
	width: 100% !important;
}

.box-dashboard-message.wppm-ui-v2 .wppm-filter-list input:checked + label {
	background: var(--wppm-accent) !important;
	color: #fff !important;
}

/* Remove generic theme button contracts from all inbox actions. */
.box-dashboard-message.wppm-ui-v2 button,
.box-dashboard-message.wppm-ui-v2 [type="button"],
.box-dashboard-message.wppm-ui-v2 [type="submit"] {
	-webkit-appearance: none !important;
	appearance: none !important;
	box-shadow: none;
	float: none !important;
	letter-spacing: normal !important;
	line-height: 1 !important;
	max-width: none !important;
	text-indent: 0 !important;
	text-transform: none !important;
}

.box-dashboard-message.wppm-ui-v2 .wppm-search-submit {
	align-items: center !important;
	display: flex !important;
	height: 36px !important;
	justify-content: center !important;
	margin: 0 !important;
	min-height: 36px !important;
	min-width: 36px !important;
	padding: 0 !important;
	position: absolute !important;
	right: 4px !important;
	top: 4px !important;
	width: 36px !important;
}

.box-dashboard-message.wppm-ui-v2 .wppm-conversations-toggle {
	float: none !important;
	margin: 0 0 10px !important;
	max-width: none !important;
	width: 100% !important;
}

.box-dashboard-message.wppm-ui-v2 .wppm-delete-conversation {
	align-items: center !important;
	background: #fff2f2 !important;
	border: 0 !important;
	border-radius: 999px !important;
	color: #d92d20 !important;
	display: inline-flex !important;
	font-size: 12px !important;
	font-weight: 800 !important;
	gap: 6px !important;
	height: 38px !important;
	justify-content: center !important;
	margin: 0 !important;
	min-height: 38px !important;
	padding: 0 13px !important;
	position: static !important;
	width: auto !important;
}

.box-dashboard-message.wppm-ui-v2 .wppm-delete-conversation svg {
	display: block !important;
	flex: 0 0 auto !important;
	height: 17px !important;
	width: 17px !important;
}

/* Composer: reserve explicit room for the send button so it cannot overlap
 * or get clipped by theme .button/.btn rules. */
.box-dashboard-message.wppm-ui-v2 .reply-message-form-wrapper,
.box-dashboard-message.wppm-ui-v2 .reply-message-form {
	float: none !important;
	max-width: none !important;
	width: 100% !important;
}

.box-dashboard-message.wppm-ui-v2 .wppm-composer {
	align-items: flex-end !important;
	display: grid !important;
	gap: 8px !important;
	grid-template-columns: minmax(0, 1fr) auto !important;
	max-width: none !important;
	overflow: visible !important;
	position: relative !important;
	width: 100% !important;
}

.box-dashboard-message.wppm-ui-v2 .wppm-composer textarea {
	float: none !important;
	height: auto !important;
	max-width: none !important;
	min-width: 0 !important;
	position: static !important;
	width: 100% !important;
}

.box-dashboard-message.wppm-ui-v2 .wppm-send-reply {
	align-items: center !important;
	background: linear-gradient(135deg, var(--wppm-accent), var(--wppm-accent-strong)) !important;
	border: 0 !important;
	border-radius: 12px !important;
	color: #fff !important;
	display: inline-flex !important;
	font-size: 13px !important;
	font-weight: 800 !important;
	gap: 7px !important;
	height: 42px !important;
	justify-content: center !important;
	margin: 0 !important;
	min-height: 42px !important;
	min-width: 104px !important;
	overflow: visible !important;
	padding: 0 15px !important;
	position: static !important;
	white-space: nowrap !important;
	width: auto !important;
}

.box-dashboard-message.wppm-ui-v2 .wppm-send-reply span,
.box-dashboard-message.wppm-ui-v2 .wppm-send-reply svg {
	display: block !important;
	position: static !important;
}

.box-dashboard-message.wppm-ui-v2 .wppm-send-reply svg {
	flex: 0 0 auto !important;
	height: 17px !important;
	width: 17px !important;
}

/* Conversation header and empty state must not inherit old card/footer rules. */
.box-dashboard-message.wppm-ui-v2 .recipient-info,
.box-dashboard-message.wppm-ui-v2 .recipient-info .message-item,
.box-dashboard-message.wppm-ui-v2 .wppm-header-actions,
.box-dashboard-message.wppm-ui-v2 .wppm-conversation-start {
	float: none !important;
	max-width: none !important;
}

.box-dashboard-message.wppm-ui-v2 .recipient-info .message-item {
	background: transparent !important;
	border: 0 !important;
	box-shadow: none !important;
	margin: 0 !important;
	padding: 0 !important;
	width: auto !important;
}

.box-dashboard-message.wppm-ui-v2 .wppm-conversation-start {
	width: 100% !important;
}

/* Replaces the removed pseudo-element loading spinner with an SVG pulse. */
.box-dashboard-message.wppm-ui-v2 button.loading svg {
	animation: wppm-compat-pulse .75s ease-in-out infinite alternate;
}

@keyframes wppm-compat-pulse {
	from { opacity: .35; transform: scale(.9); }
	to { opacity: 1; transform: scale(1); }
}

@media (max-width: 860px) {
	.box-dashboard-message.wppm-ui-v2 .message-inner {
		display: block !important;
	}

	.box-dashboard-message.wppm-ui-v2 .wppm-delete-conversation {
		padding: 0 !important;
		width: 38px !important;
	}

	.box-dashboard-message.wppm-ui-v2 .wppm-delete-conversation span {
		display: none !important;
	}
}

@media (max-width: 520px) {
	.box-dashboard-message.wppm-ui-v2 .wppm-composer {
		grid-template-columns: minmax(0, 1fr) 42px !important;
	}

	.box-dashboard-message.wppm-ui-v2 .wppm-send-reply {
		font-size: 0 !important;
		min-width: 42px !important;
		padding: 0 !important;
		width: 42px !important;
	}

	.box-dashboard-message.wppm-ui-v2 .wppm-send-reply svg {
		display: block !important;
		height: 19px !important;
		width: 19px !important;
	}
}

/* 1.2.2 mobile app shell must win over legacy theme positioning. */
@media (max-width: 860px) {
	.box-dashboard-message.wppm-ui-v2.wppm-mobile-app {
		height: var(--wppm-mobile-height, 100dvh) !important;
		inset: 0 !important;
		position: fixed !important;
		width: 100vw !important;
	}

	.box-dashboard-message.wppm-ui-v2.wppm-mobile-app .message-inner {
		display: block !important;
		height: 100% !important;
		position: relative !important;
	}

	.box-dashboard-message.wppm-ui-v2.wppm-mobile-app .list-message-wrapper,
	.box-dashboard-message.wppm-ui-v2.wppm-mobile-app .replies-content {
		height: 100% !important;
		inset: 0 !important;
		position: absolute !important;
		width: 100% !important;
	}

	.box-dashboard-message.wppm-ui-v2.wppm-mobile-app .wppm-back-btn {
		display: inline-flex !important;
		padding: 0 5px 0 0 !important;
		width: auto !important;
	}

	.box-dashboard-message.wppm-ui-v2.wppm-mobile-app .wppm-back-btn span {
		display: inline !important;
	}
}

@media (max-width: 782px) {
	body.admin-bar .box-dashboard-message.wppm-ui-v2.wppm-mobile-app {
		height: calc(var(--wppm-mobile-height, 100dvh) - 46px) !important;
		top: 46px !important;
	}
}

@media (min-width: 783px) and (max-width: 860px) {
	body.admin-bar .box-dashboard-message.wppm-ui-v2.wppm-mobile-app {
		height: calc(var(--wppm-mobile-height, 100dvh) - 32px) !important;
		top: 32px !important;
	}
}


/* 1.3.0 compatibility: preserve Paktograf native mobile nav + emoji composer. */
@media (max-width: 860px) {
	.box-dashboard-message.wppm-ui-v2.wppm-mobile-app,
	body.admin-bar .box-dashboard-message.wppm-ui-v2.wppm-mobile-app {
		bottom: var(--wppm-pg-bottom-nav, 72px) !important;
		height: auto !important;
		inset: var(--wppm-pg-top-nav, 64px) 0 var(--wppm-pg-bottom-nav, 72px) 0 !important;
		top: var(--wppm-pg-top-nav, 64px) !important;
		z-index: 100 !important;
	}

	.box-dashboard-message.wppm-ui-v2.wppm-mobile-app .wppm-back-btn span {
		display: none !important;
	}
}

.box-dashboard-message.wppm-ui-v2 .wppm-composer {
	grid-template-columns: 38px minmax(0, 1fr) auto !important;
}

@media (max-width: 520px) {
	.box-dashboard-message.wppm-ui-v2 .wppm-composer {
		grid-template-columns: 38px minmax(0, 1fr) 42px !important;
	}
}

/* 1.3.0 final visual shield — loaded after style.css. */
.box-dashboard-message.wppm-ui-v2 .wppm-search-submit {
	left: 5px !important;
	right: auto !important;
	top: 50% !important;
	transform: translateY(-50%) !important;
}

.box-dashboard-message.wppm-ui-v2 .wppm-filter-list input:checked + label {
	background: #f3f0fb !important;
	border-color: #e4dcf7 !important;
	color: #5b21b6 !important;
}

.box-dashboard-message.wppm-ui-v2 .wppm-send-reply {
	background: #6d28d9 !important;
}

.box-dashboard-message.wppm-ui-v2 .wppm-send-reply:hover,
.box-dashboard-message.wppm-ui-v2 .wppm-send-reply:focus-visible {
	background: #5b21b6 !important;
}

@media (max-width: 860px) {
	.box-dashboard-message.wppm-ui-v2.wppm-mobile-app {
		background: #fff !important;
	}
}


/* =========================================================
   PAKTOGRAF PORUKE 1.3.2 — hard composer/bubble layout fix
   compat.css is loaded last, so these rules intentionally win
   over both theme styles and the older compatibility shield.
   ========================================================= */
.box-dashboard-message.wppm-ui-v2 .reply-message-form-wrapper,
.box-dashboard-message.wppm-ui-v2 .reply-message-form {
    box-sizing: border-box !important;
    display: block !important;
    float: none !important;
    height: auto !important;
    min-height: 0 !important;
    max-width: none !important;
    overflow: visible !important;
    width: 100% !important;
}

.box-dashboard-message.wppm-ui-v2 .wppm-composer {
    align-items: center !important;
    display: flex !important;
    flex-flow: row nowrap !important;
    gap: 8px !important;
    grid-template-columns: none !important;
    height: auto !important;
    min-height: 58px !important;
    max-height: none !important;
    padding: 6px 7px !important;
    width: 100% !important;
}

.box-dashboard-message.wppm-ui-v2 .wppm-emoji-wrap {
    align-self: center !important;
    flex: 0 0 34px !important;
    min-width: 34px !important;
    width: 34px !important;
    order: 1 !important;
}

.box-dashboard-message.wppm-ui-v2 .wppm-composer textarea,
.box-dashboard-message.wppm-ui-v2 .wppm-composer textarea.form-control,
.box-dashboard-message.wppm-ui-v2 .wppm-composer textarea:focus,
.box-dashboard-message.wppm-ui-v2 .wppm-composer textarea:focus-visible {
    box-sizing: border-box !important;
    display: block !important;
    flex: 1 1 0% !important;
    float: none !important;
    height: 44px !important;
    min-height: 44px !important;
    max-height: 112px !important;
    min-width: 0 !important;
    max-width: none !important;
    width: 0 !important;
    margin: 0 !important;
    padding: 11px 7px !important;
    position: static !important;
    resize: none !important;
    order: 2 !important;
    white-space: pre-wrap !important;
    word-break: normal !important;
    overflow-wrap: break-word !important;
}

.box-dashboard-message.wppm-ui-v2 .wppm-send-reply,
.box-dashboard-message.wppm-ui-v2 button.wppm-send-reply {
    align-self: center !important;
    flex: 0 0 104px !important;
    height: 44px !important;
    min-height: 44px !important;
    min-width: 104px !important;
    max-width: 104px !important;
    width: 104px !important;
    margin: 0 !important;
    padding: 0 14px !important;
    position: static !important;
    order: 3 !important;
}

/* Natural chat bubble width: short messages stay short, normal words never stack vertically. */
.box-dashboard-message.wppm-ui-v2 .list-replies > li,
.box-dashboard-message.wppm-ui-v2 .list-replies > li.yourself-reply,
.box-dashboard-message.wppm-ui-v2 .list-replies > li.user-reply {
    display: flex !important;
    flex: 0 0 auto !important;
    width: fit-content !important;
    max-width: 76% !important;
    min-width: 0 !important;
    gap: 6px !important;
}

.box-dashboard-message.wppm-ui-v2 .list-replies > li.yourself-reply {
    align-self: flex-end !important;
    margin-left: auto !important;
}
.box-dashboard-message.wppm-ui-v2 .list-replies > li.user-reply {
    align-self: flex-start !important;
    margin-right: auto !important;
}

.box-dashboard-message.wppm-ui-v2 .reply-content {
    display: flex !important;
    flex: 0 1 auto !important;
    min-width: 0 !important;
    width: fit-content !important;
    max-width: calc(100% - 30px) !important;
}

.box-dashboard-message.wppm-ui-v2 .post-content {
    box-sizing: border-box !important;
    display: block !important;
    min-width: 0 !important;
    width: fit-content !important;
    max-width: 100% !important;
    white-space: pre-wrap !important;
    word-break: normal !important;
    overflow-wrap: break-word !important;
    hyphens: none !important;
}

.box-dashboard-message.wppm-ui-v2 .list-replies .avatar {
    flex: 0 0 24px !important;
    min-width: 24px !important;
    width: 24px !important;
    min-height: 24px !important;
}
.box-dashboard-message.wppm-ui-v2 .list-replies .avatar .wppm-paktograf-avatar,
.box-dashboard-message.wppm-ui-v2 .list-replies .avatar img.wppm-paktograf-avatar,
.box-dashboard-message.wppm-ui-v2 .list-replies .avatar .wppm-bubble-avatar,
.box-dashboard-message.wppm-ui-v2 .list-replies .avatar img.wppm-bubble-avatar {
    box-sizing: border-box !important;
    height: 24px !important;
    min-height: 24px !important;
    min-width: 24px !important;
    width: 24px !important;
}

@media (max-width: 860px) {
    .box-dashboard-message.wppm-ui-v2.wppm-mobile-app .reply-message-form-wrapper {
        padding: 7px 8px calc(7px + env(safe-area-inset-bottom)) !important;
    }

    .box-dashboard-message.wppm-ui-v2.wppm-mobile-app .wppm-composer {
        display: flex !important;
        flex-flow: row nowrap !important;
        gap: 6px !important;
        grid-template-columns: none !important;
        min-height: 58px !important;
        max-height: none !important;
        padding: 6px !important;
    }

    .box-dashboard-message.wppm-ui-v2.wppm-mobile-app .wppm-emoji-wrap {
        flex: 0 0 32px !important;
        min-width: 32px !important;
        width: 32px !important;
    }

    .box-dashboard-message.wppm-ui-v2.wppm-mobile-app .wppm-composer textarea,
    .box-dashboard-message.wppm-ui-v2.wppm-mobile-app .wppm-composer textarea.form-control,
    .box-dashboard-message.wppm-ui-v2.wppm-mobile-app .wppm-composer textarea:focus,
    .box-dashboard-message.wppm-ui-v2.wppm-mobile-app .wppm-composer textarea:focus-visible {
        flex: 1 1 0% !important;
        width: 0 !important;
        min-width: 0 !important;
        max-width: none !important;
        height: 44px !important;
        min-height: 44px !important;
        max-height: 96px !important;
        padding: 11px 6px !important;
        font-size: 15px !important;
    }

    .box-dashboard-message.wppm-ui-v2.wppm-mobile-app .wppm-send-reply,
    .box-dashboard-message.wppm-ui-v2.wppm-mobile-app button.wppm-send-reply {
        flex: 0 0 46px !important;
        height: 46px !important;
        min-height: 46px !important;
        min-width: 46px !important;
        max-width: 46px !important;
        width: 46px !important;
        padding: 0 !important;
    }

    .box-dashboard-message.wppm-ui-v2.wppm-mobile-app .list-replies > li,
    .box-dashboard-message.wppm-ui-v2.wppm-mobile-app .list-replies > li.yourself-reply,
    .box-dashboard-message.wppm-ui-v2.wppm-mobile-app .list-replies > li.user-reply {
        width: fit-content !important;
        max-width: 82% !important;
        gap: 5px !important;
    }

    .box-dashboard-message.wppm-ui-v2.wppm-mobile-app .reply-content {
        width: fit-content !important;
        max-width: calc(100% - 27px) !important;
    }

    .box-dashboard-message.wppm-ui-v2.wppm-mobile-app .list-replies .avatar {
        flex-basis: 22px !important;
        min-width: 22px !important;
        width: 22px !important;
        min-height: 22px !important;
    }
    .box-dashboard-message.wppm-ui-v2.wppm-mobile-app .list-replies .avatar .wppm-paktograf-avatar,
    .box-dashboard-message.wppm-ui-v2.wppm-mobile-app .list-replies .avatar img.wppm-paktograf-avatar,
    .box-dashboard-message.wppm-ui-v2.wppm-mobile-app .list-replies .avatar .wppm-bubble-avatar,
    .box-dashboard-message.wppm-ui-v2.wppm-mobile-app .list-replies .avatar img.wppm-bubble-avatar {
        height: 22px !important;
        min-height: 22px !important;
        min-width: 22px !important;
        width: 22px !important;
    }
}


/* =========================================================
   PAKTOGRAF PORUKE 1.3.3 — stable bubble geometry
   Full-width rows remove the shrink-to-min-content loop that made
   short mobile messages wrap character-by-character. Bubbles keep
   their natural width inside a readable maximum.
   ========================================================= */
.box-dashboard-message.wppm-ui-v2 .list-replies {
    width: 100% !important;
    padding-bottom: 14px !important;
}

.box-dashboard-message.wppm-ui-v2 .list-replies > li,
.box-dashboard-message.wppm-ui-v2 .list-replies > li.yourself-reply,
.box-dashboard-message.wppm-ui-v2 .list-replies > li.user-reply {
    box-sizing: border-box !important;
    display: flex !important;
    flex: 0 0 auto !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    gap: 6px !important;
}

.box-dashboard-message.wppm-ui-v2 .list-replies > li.yourself-reply {
    align-self: stretch !important;
    justify-content: flex-end !important;
    margin-left: 0 !important;
}

.box-dashboard-message.wppm-ui-v2 .list-replies > li.user-reply {
    align-self: stretch !important;
    justify-content: flex-start !important;
    margin-right: 0 !important;
}

.box-dashboard-message.wppm-ui-v2 .reply-content {
    box-sizing: border-box !important;
    display: flex !important;
    flex: 0 1 auto !important;
    flex-direction: column !important;
    min-width: 0 !important;
    width: auto !important;
    max-width: min(72%, 720px) !important;
}

.box-dashboard-message.wppm-ui-v2 .yourself-reply .reply-content {
    align-items: flex-end !important;
}

.box-dashboard-message.wppm-ui-v2 .user-reply .reply-content {
    align-items: flex-start !important;
}

.box-dashboard-message.wppm-ui-v2 .post-content {
    box-sizing: border-box !important;
    display: inline-block !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: 100% !important;
    white-space: pre-wrap !important;
    word-break: normal !important;
    overflow-wrap: break-word !important;
    hyphens: none !important;
}

.box-dashboard-message.wppm-ui-v2 .post-date {
    flex: 0 0 auto !important;
}

@media (max-width: 860px) {
    .box-dashboard-message.wppm-ui-v2.wppm-mobile-app .list-replies-inner {
        padding-bottom: 18px !important;
    }

    .box-dashboard-message.wppm-ui-v2.wppm-mobile-app .list-replies > li,
    .box-dashboard-message.wppm-ui-v2.wppm-mobile-app .list-replies > li.yourself-reply,
    .box-dashboard-message.wppm-ui-v2.wppm-mobile-app .list-replies > li.user-reply {
        width: 100% !important;
        max-width: 100% !important;
        gap: 5px !important;
    }

    .box-dashboard-message.wppm-ui-v2.wppm-mobile-app .reply-content {
        width: auto !important;
        max-width: calc(78% - 27px) !important;
    }

    .box-dashboard-message.wppm-ui-v2.wppm-mobile-app .post-content {
        width: auto !important;
        max-width: 100% !important;
        white-space: pre-wrap !important;
        word-break: normal !important;
        overflow-wrap: break-word !important;
    }
}

/* =========================================================
   PAKTOGRAF PORUKE 1.3.4 — final viewport/scroll alignment
   One real scrollbar, reachable last message, optical composer centering.
   ========================================================= */
.box-dashboard-message.wppm-ui-v2 .message-section-wrapper {
    overflow: hidden !important;
}

.box-dashboard-message.wppm-ui-v2 .message-inner {
    align-items: stretch !important;
}

.box-dashboard-message.wppm-ui-v2 .list-message-wrapper,
.box-dashboard-message.wppm-ui-v2 .replies-content {
    min-height: 0 !important;
    height: 100% !important;
    overflow: hidden !important;
}

.box-dashboard-message.wppm-ui-v2 .replies-content,
.box-dashboard-message.wppm-ui-v2 .content-box-white {
    min-height: 0 !important;
    overflow: hidden !important;
}

/* The conversation viewport is the ONLY scrolling surface on the chat side. */
.box-dashboard-message.wppm-ui-v2 .list-replies-inner {
    box-sizing: border-box !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    overscroll-behavior-y: contain !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-gutter: stable !important;
    padding-top: 28px !important;
    padding-bottom: 34px !important;
    scroll-padding-top: 28px !important;
    scroll-padding-bottom: 34px !important;
}

/* Remove PerfectScrollbar rails left behind by old builds on the message viewport. */
.box-dashboard-message.wppm-ui-v2 .list-replies-inner > .ps-scrollbar-y-rail,
.box-dashboard-message.wppm-ui-v2 .list-replies-inner > .ps-scrollbar-x-rail,
.box-dashboard-message.wppm-ui-v2 .list-replies-inner > .ps__rail-y,
.box-dashboard-message.wppm-ui-v2 .list-replies-inner > .ps__rail-x {
    display: none !important;
}

/* Keep enough breathing room above the composer and let the last bubble be reachable. */
.box-dashboard-message.wppm-ui-v2 .list-replies {
    box-sizing: border-box !important;
    padding-bottom: 18px !important;
}

/* Composer remains a fixed flex item at the bottom; no nested scroll. */
.box-dashboard-message.wppm-ui-v2 .reply-message-form-wrapper {
    box-sizing: border-box !important;
    flex: 0 0 auto !important;
    overflow: visible !important;
    border-top: 0 !important;
    box-shadow: none !important;
    padding-left: 12px !important;
    padding-right: 20px !important;
}

/* Optical centering: the send button makes the row feel right-heavy. */
.box-dashboard-message.wppm-ui-v2 .wppm-composer {
    box-sizing: border-box !important;
    transform: translateX(-6px) !important;
    width: calc(100% + 6px) !important;
}

/* One subtle border language for the temporary unlocked-contact notice. */
.box-dashboard-message.wppm-ui-v2 .wppm-notice-success,
.box-dashboard-message.wppm-ui-v2 [data-wppm-unlock-notice] {
    background: #f5f3ff !important;
    border: 1px solid #ded5f4 !important;
    color: #4c1d95 !important;
    box-shadow: none !important;
}

/* Desktop shell: both columns terminate on the same baseline. */
@media (min-width: 861px) {
    .box-dashboard-message.wppm-ui-v2 .message-inner {
        min-height: 620px !important;
    }

    .box-dashboard-message.wppm-ui-v2 .list-message-wrapper,
    .box-dashboard-message.wppm-ui-v2 .replies-content {
        align-self: stretch !important;
    }
}

@media (max-width: 860px) {
    .box-dashboard-message.wppm-ui-v2.wppm-mobile-app .replies-content,
    .box-dashboard-message.wppm-ui-v2.wppm-mobile-app .content-box-white {
        min-height: 0 !important;
        overflow: hidden !important;
    }

    .box-dashboard-message.wppm-ui-v2.wppm-mobile-app .list-replies-inner {
        padding-top: 26px !important;
        padding-left: 8px !important;
        padding-right: 8px !important;
        padding-bottom: 30px !important;
        scroll-padding-top: 26px !important;
        scroll-padding-bottom: 30px !important;
    }

    .box-dashboard-message.wppm-ui-v2.wppm-mobile-app .reply-message-form-wrapper {
        padding-left: 7px !important;
        padding-right: 11px !important;
        padding-bottom: calc(7px + env(safe-area-inset-bottom)) !important;
    }

    .box-dashboard-message.wppm-ui-v2.wppm-mobile-app .wppm-composer {
        transform: translateX(-4px) !important;
        width: calc(100% + 4px) !important;
    }
}

/* =========================================================
   PAKTOGRAF PORUKE 1.3.5 — FINAL CHAT POLISH
   - composer optički malo ulijevo
   - više zraka u message listi
   - desktop okvir +5px niže
   - "Kontakt otključan" potpuno Paktograf ljubičast
   - ne dira postojeći single-scroll fix
   ========================================================= */


/* ---------------------------------------------------------
   1. KONTAKT OTKLJUČAN
   Bez zelenog bordera — samo suptilni Paktograf purple.
   --------------------------------------------------------- */

.box-dashboard-message.wppm-ui-v2 .wppm-status-badge {
    background: #f5f3ff !important;
    border: 1px solid #ddd6fe !important;
    color: #6d28d9 !important;
    box-shadow: none !important;
}

.box-dashboard-message.wppm-ui-v2 .wppm-status-badge svg {
    color: #6d28d9 !important;
    stroke: currentColor !important;
}


/* ---------------------------------------------------------
   2. MESSAGE LIST
   Malo više zraka ispod headera.
   Scroll ostaje ISKLJUČIVO na ovom elementu.
   --------------------------------------------------------- */

.box-dashboard-message.wppm-ui-v2 .list-replies-inner {
    padding-top: 34px !important;
    scroll-padding-top: 34px !important;

    /* ostavljamo dovoljno mjesta da zadnja poruka
       nikad ne sjedne direktno na composer */
    padding-bottom: 38px !important;
    scroll-padding-bottom: 38px !important;
}


/* ---------------------------------------------------------
   3. COMPOSER
   Matematički je bio centriran, ali ga send button vizualno
   vuče udesno. Namjerno ga pomjeramo malo lijevo.
   --------------------------------------------------------- */

.box-dashboard-message.wppm-ui-v2 .reply-message-form-wrapper {
    box-sizing: border-box !important;
    border-top: 0 !important;
    box-shadow: none !important;

    padding-left: 16px !important;
    padding-right: 22px !important;
}

.box-dashboard-message.wppm-ui-v2 .wppm-composer {
    box-sizing: border-box !important;

    transform: translateX(-10px) !important;
    width: calc(100% + 10px) !important;

    margin-left: 0 !important;
    margin-right: 0 !important;
}


/* ---------------------------------------------------------
   4. DESKTOP
   Donji rub cijelog chat modula spuštamo oko 5px.
   Lijeva lista i desni chat ostaju na istoj baseline liniji.
   --------------------------------------------------------- */

@media (min-width: 861px) {

    .box-dashboard-message.wppm-ui-v2 .message-inner {
        height: min(735px, calc(100vh - 205px)) !important;
        min-height: 625px !important;
        align-items: stretch !important;
    }

    .box-dashboard-message.wppm-ui-v2 .list-message-wrapper,
    .box-dashboard-message.wppm-ui-v2 .replies-content {
        height: 100% !important;
        min-height: 0 !important;
        align-self: stretch !important;
        box-sizing: border-box !important;
    }

    /*
     * Dajemo sidebaru tih nekoliko piksela prostora na dnu,
     * umjesto da crtamo/uklanjamo novi border.
     */
    .box-dashboard-message.wppm-ui-v2 .list-message-inner {
        box-sizing: border-box !important;
        padding-bottom: 5px !important;
    }
}


/* ---------------------------------------------------------
   5. MOBILE
   Još malo blaži pomak composera ulijevo.
   Ne diramo njegovu visinu ni single-scroll ponašanje.
   --------------------------------------------------------- */

@media (max-width: 860px) {

    .box-dashboard-message.wppm-ui-v2.wppm-mobile-app .list-replies-inner {
        padding-top: 32px !important;
        scroll-padding-top: 32px !important;

        padding-left: 8px !important;
        padding-right: 8px !important;

        padding-bottom: 36px !important;
        scroll-padding-bottom: 36px !important;
    }

    .box-dashboard-message.wppm-ui-v2.wppm-mobile-app .reply-message-form-wrapper {
        padding-left: 10px !important;
        padding-right: 14px !important;
        padding-bottom: calc(8px + env(safe-area-inset-bottom)) !important;
    }

    .box-dashboard-message.wppm-ui-v2.wppm-mobile-app .wppm-composer {
        transform: translateX(-8px) !important;
        width: calc(100% + 8px) !important;
    }
}
