/* Campus Press Messages — Instagram DM UI, Feed Post Share Cards & Press-and-Hold Actions */

.cp-dm-page-wrap {
	padding-top: 14px;
	padding-bottom: 24px;
}

.cp-dm-auth-gate {
	max-width: 460px;
	margin: 36px auto;
}

.cp-dm-gate-card {
	background: #ffffff;
	border: 1px solid #dbdbdb;
	border-radius: 16px;
	padding: 36px 24px;
	text-align: center;
}

.cp-dm-gate-icon {
	width: 72px;
	height: 72px;
	margin: 0 auto 14px;
	border: 2px solid #0f1419;
	border-radius: 999px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.cp-dm-shell {
	display: grid;
	grid-template-columns: 330px minmax(0, 1fr);
	height: min(78vh, 720px);
	min-height: 520px;
	background: #ffffff;
	border: 1px solid #dbdbdb;
	border-radius: 14px;
	overflow: hidden;
}

/* Inbox Pane */
.cp-dm-inbox-pane {
	display: flex;
	flex-direction: column;
	border-right: 1px solid #efefef;
	min-height: 0;
}

.cp-dm-inbox-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px 16px 10px;
}

.cp-dm-owner-title {
	margin: 0;
	font-size: 18px;
	font-weight: 800;
	display: inline-flex;
	align-items: center;
	gap: 8px;
}

.cp-dm-head-dot {
	width: 8px;
	height: 8px;
	border-radius: 999px;
	background: #ef4444;
}

.cp-dm-icon-btn {
	background: transparent;
	border: 0;
	padding: 6px;
	cursor: pointer;
	color: #0f1419;
	border-radius: 999px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.cp-dm-icon-btn:hover {
	background: #f5f5f5;
}

.cp-dm-search-bar {
	margin: 0 14px 10px;
	background: #efefef;
	border-radius: 12px;
	padding: 7px 11px;
	display: flex;
	align-items: center;
	gap: 8px;
	color: #737373;
}

.cp-dm-search-bar input {
	border: 0;
	background: transparent;
	width: 100%;
	font-size: 14px;
	color: #0f1419;
}

.cp-dm-search-bar input:focus {
	outline: none;
}

.cp-dm-threads-list {
	flex: 1;
	overflow-y: auto;
	padding: 4px 0;
}

.cp-dm-thread-row {
	width: 100%;
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 16px;
	border: 0;
	background: transparent;
	text-align: left;
	cursor: pointer;
}

.cp-dm-thread-row:hover {
	background: #fafafa;
}

.cp-dm-thread-row.is-active {
	background: #efefef;
}

.cp-dm-avatar-ring {
	width: 52px;
	height: 52px;
	border-radius: 999px;
	padding: 2px;
	flex-shrink: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.cp-dm-avatar-ring.has-ring {
	background: linear-gradient(135deg, #f58529, #dd2a7b 48%, #8134af);
}

.cp-dm-avatar {
	width: 46px;
	height: 46px;
	border-radius: 999px;
	background: linear-gradient(135deg, #0b1120, #1d4ed8);
	color: #ffffff;
	font-size: 15px;
	font-weight: 800;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 2px solid #ffffff;
	flex-shrink: 0;
}

.cp-dm-thread-meta {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.cp-dm-thread-top {
	display: flex;
	align-items: center;
	gap: 4px;
	font-size: 14px;
	color: #0f1419;
}

.cp-dm-thread-top strong {
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.cp-dm-thread-sub {
	font-size: 12.5px;
	color: #737373;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.cp-dm-thread-row.is-unread .cp-dm-thread-sub {
	color: #0f1419;
	font-weight: 700;
}

.cp-dm-unread-dot {
	width: 8px;
	height: 8px;
	border-radius: 999px;
	background: #0095f6;
	flex-shrink: 0;
}

.cp-dm-empty-box {
	padding: 28px 18px;
	text-align: center;
	color: #737373;
	font-size: 13.5px;
}

.cp-dm-empty-note {
	padding: 18px;
	text-align: center;
	color: #737373;
	font-size: 13.5px;
	margin: 0;
}

/* Chat Thread Pane */
.cp-dm-chat-pane {
	display: flex;
	flex-direction: column;
	min-height: 0;
	background: #ffffff;
}

.cp-dm-placeholder {
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	padding: 32px;
}

.cp-dm-placeholder h2 {
	margin: 0 0 6px;
	font-size: 20px;
}

.cp-dm-placeholder p {
	margin: 0 0 18px;
	color: #737373;
	font-size: 14px;
}

.cp-dm-conversation {
	display: flex;
	flex-direction: column;
	height: 100%;
	min-height: 0;
}

.cp-dm-chat-header {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 12px 16px;
	border-bottom: 1px solid #efefef;
}

.cp-dm-back-btn {
	display: none;
	border: 0;
	background: transparent;
	padding: 4px;
	cursor: pointer;
	color: #0f1419;
}

.cp-dm-peer-link {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	color: inherit;
	text-decoration: none;
}

.cp-dm-peer-avatar {
	width: 38px;
	height: 38px;
	border-radius: 999px;
	background: linear-gradient(135deg, #0b1120, #1d4ed8);
	color: #ffffff;
	font-size: 13px;
	font-weight: 800;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.cp-dm-peer-meta {
	display: flex;
	flex-direction: column;
	line-height: 1.2;
}

.cp-dm-peer-meta strong {
	font-size: 14.5px;
	display: inline-flex;
	align-items: center;
	gap: 4px;
}

.cp-dm-peer-meta small {
	font-size: 12px;
	color: #737373;
}

.cp-dm-messages-scroll {
	flex: 1;
	overflow-y: auto;
	padding: 16px;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.cp-dm-thread-start {
	margin: auto;
	text-align: center;
	color: #737373;
	font-size: 13.5px;
}

.cp-dm-msg-row {
	display: flex;
	flex-direction: column;
	max-width: 78%;
	align-items: flex-start;
	user-select: none;
	-webkit-user-select: none;
}

.cp-dm-msg-row.is-mine {
	align-self: flex-end;
	align-items: flex-end;
}

.cp-dm-msg-row.has-reactions {
	margin-bottom: 12px;
}

.cp-dm-reply-quote {
	background: #f5f5f5;
	border-left: 3px solid #cbd5e1;
	padding: 4px 9px;
	border-radius: 8px;
	margin-bottom: 4px;
	font-size: 12px;
	color: #475569;
	max-width: 280px;
}

.cp-dm-reply-quote small {
	display: block;
	font-weight: 700;
	font-size: 11px;
}

.cp-dm-reply-quote span {
	display: block;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.cp-dm-bubble-stage {
	display: flex;
	align-items: center;
	gap: 6px;
	max-width: 100%;
}

.cp-dm-side-btns {
	display: flex;
	flex-direction: column;
	gap: 4px;
	opacity: 0.72;
	transition: opacity 0.14s ease;
}

.cp-dm-msg-row:hover .cp-dm-side-btns {
	opacity: 1;
}

.cp-dm-quick-btn {
	width: 28px;
	height: 28px;
	border-radius: 999px;
	border: 1px solid #e5e7eb;
	background: #f8fafc;
	color: #0f1419;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	padding: 0;
	font-size: 14px;
}

.cp-dm-quick-btn:hover {
	background: #e2e8f0;
}

.cp-dm-bubble {
	position: relative;
	touch-action: pan-y;
}

.cp-dm-bubble.is-text-bubble {
	padding: 9px 14px;
	border-radius: 20px;
	font-size: 14px;
	line-height: 1.42;
	background: #efefef;
	color: #0f1419;
	word-break: break-word;
}

.cp-dm-msg-row.is-mine .cp-dm-bubble.is-text-bubble {
	background: #3797f0;
	color: #ffffff;
}

/* Shared / Forwarded Feed Post Card inside DM Bubble (matches Feed look, zero action bar) */
.cp-dm-post-card {
	display: block;
	width: min(296px, 68vw);
	text-decoration: none;
	color: #0f1419;
	background: #fafafa;
	border: 1px solid #dbdbdb;
	border-radius: 16px;
	overflow: hidden;
	box-shadow: 0 2px 10px rgba(15, 20, 25, 0.06);
}

.cp-dm-post-card:hover {
	text-decoration: none;
	border-color: #94a3b8;
}

.cp-dm-post-card .cp-ig-post-head {
	padding: 9px 11px;
	background: #ffffff;
}

.cp-dm-post-card .cp-news-card {
	aspect-ratio: 4 / 4.4;
	border-radius: 0;
}

.cp-dm-post-card .cp-news-card-inner {
	padding: 12px;
}

.cp-dm-post-card .cp-news-card-title {
	font-size: 15px;
	line-height: 1.24;
}

.cp-dm-post-card .cp-news-card-summary {
	font-size: 12px;
	-webkit-line-clamp: 2;
}

.cp-dm-post-card .cp-ig-post-caption {
	padding: 8px 11px 10px;
	background: #ffffff;
	border-top: 1px solid #efefef;
	font-size: 12.5px;
}

.cp-dm-reaction-badge {
	position: absolute;
	bottom: -11px;
	left: 10px;
	background: #ffffff;
	border: 1.5px solid #e5e7eb;
	border-radius: 999px;
	padding: 1px 6px;
	display: inline-flex;
	align-items: center;
	gap: 3px;
	font-size: 12.5px;
	cursor: pointer;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.cp-dm-msg-row.is-mine .cp-dm-reaction-badge {
	left: auto;
	right: 10px;
}

.cp-dm-react-chip.is-me {
	font-weight: 700;
}

.cp-dm-react-chip small {
	font-size: 11px;
	margin-left: 1px;
	color: #475569;
}

.cp-dm-receipt {
	font-size: 11px;
	color: #737373;
	margin-top: 3px;
	padding-right: 6px;
}

/* Composer */
.cp-dm-composer-wrap {
	padding: 10px 14px 12px;
	border-top: 1px solid #efefef;
	background: #ffffff;
}

.cp-dm-reply-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 6px 10px;
	margin-bottom: 8px;
	background: #f8fafc;
	border-left: 3px solid #0095f6;
	border-radius: 8px;
}

.cp-dm-reply-copy {
	min-width: 0;
	display: flex;
	flex-direction: column;
}

.cp-dm-reply-copy small {
	font-size: 11.5px;
	font-weight: 700;
	color: #0095f6;
}

.cp-dm-reply-copy span {
	font-size: 12.5px;
	color: #475569;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.cp-dm-reply-cancel {
	border: 0;
	background: transparent;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	color: #64748b;
}

.cp-dm-composer-form {
	display: flex;
	align-items: center;
	gap: 10px;
	border: 1px solid #dbdbdb;
	border-radius: 999px;
	padding: 6px 14px;
}

.cp-dm-composer-form textarea {
	flex: 1;
	border: 0;
	resize: none;
	background: transparent;
	font: inherit;
	font-size: 14px;
	line-height: 1.35;
	max-height: 92px;
	padding: 4px 0;
}

.cp-dm-composer-form textarea:focus {
	outline: none;
}

.cp-dm-send-btn {
	border: 0;
	background: transparent;
	color: #0095f6;
	font-weight: 700;
	font-size: 14px;
	cursor: pointer;
	padding: 4px 6px;
}

.cp-dm-send-btn:disabled {
	opacity: 0.45;
}

/* Long-press Action Overlay + Emoji Reaction Bar */
.cp-dm-overlay,
.cp-dm-picker-modal {
	position: fixed;
	inset: 0;
	z-index: 95;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
}

.cp-dm-overlay[hidden],
.cp-dm-picker-modal[hidden] {
	display: none;
}

.cp-dm-overlay-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(15, 20, 25, 0.56);
	backdrop-filter: blur(4px);
}

.cp-dm-action-stack {
	position: relative;
	width: min(320px, 92vw);
	display: flex;
	flex-direction: column;
	gap: 12px;
	align-items: stretch;
}

.cp-dm-reaction-bar {
	background: #ffffff;
	border-radius: 999px;
	padding: 6px 10px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	box-shadow: 0 12px 30px rgba(0, 0, 0, 0.22);
}

.cp-dm-react-pill {
	width: 40px;
	height: 40px;
	border: 0;
	background: transparent;
	border-radius: 999px;
	font-size: 22px;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition: transform 0.12s ease;
}

.cp-dm-react-pill:hover,
.cp-dm-react-pill.is-active {
	background: #eff6ff;
	transform: scale(1.16);
}

.cp-dm-action-menu {
	background: #ffffff;
	border-radius: 16px;
	overflow: hidden;
	box-shadow: 0 16px 36px rgba(0, 0, 0, 0.24);
}

.cp-dm-action-time {
	padding: 9px 16px;
	font-size: 12px;
	color: #737373;
	border-bottom: 1px solid #f1f5f9;
}

.cp-dm-action-row {
	width: 100%;
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 13px 16px;
	border: 0;
	border-bottom: 1px solid #f8fafc;
	background: #ffffff;
	font-size: 14.5px;
	font-weight: 600;
	color: #0f1419;
	cursor: pointer;
	text-align: left;
}

.cp-dm-action-row:hover {
	background: #f8fafc;
}

.cp-dm-action-row.is-danger {
	color: #dc2626;
}

.cp-dm-action-row[hidden] {
	display: none;
}

/* Compose & Forward Student Picker Modal */
.cp-dm-picker-sheet {
	position: relative;
	width: min(440px, 95vw);
	max-height: 82vh;
	background: #ffffff;
	border-radius: 18px;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	box-shadow: 0 22px 48px rgba(0, 0, 0, 0.28);
}

.cp-dm-picker-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 13px 16px;
	border-bottom: 1px solid #efefef;
}

.cp-dm-picker-header h3 {
	margin: 0;
	font-size: 16px;
	font-weight: 700;
}

.cp-dm-picker-close {
	border: 0;
	background: transparent;
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
	color: #475569;
}

.cp-dm-picker-search {
	margin: 10px 14px;
	padding: 8px 12px;
	background: #efefef;
	border-radius: 10px;
	display: flex;
	align-items: center;
	gap: 8px;
}

.cp-dm-picker-search input {
	border: 0;
	background: transparent;
	width: 100%;
	font-size: 14px;
}

.cp-dm-picker-search input:focus {
	outline: none;
}

.cp-dm-picker-list {
	flex: 1;
	overflow-y: auto;
	padding: 4px 0 8px;
}

.cp-dm-picker-row {
	width: 100%;
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 9px 16px;
	border: 0;
	background: #ffffff;
	cursor: pointer;
	text-align: left;
}

.cp-dm-picker-row:hover {
	background: #fafafa;
}

.cp-dm-picker-row.is-selected {
	background: #eff6ff;
}

.cp-dm-picker-meta {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
}

.cp-dm-picker-meta strong {
	font-size: 14px;
	display: inline-flex;
	align-items: center;
	gap: 4px;
}

.cp-dm-picker-meta small {
	font-size: 12px;
	color: #737373;
}

.cp-dm-picker-check {
	width: 24px;
	height: 24px;
	border-radius: 999px;
	border: 1.5px solid #cbd5e1;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-weight: 800;
	font-size: 13px;
	color: #ffffff;
}

.cp-dm-picker-row.is-selected .cp-dm-picker-check {
	background: #0095f6;
	border-color: #0095f6;
}

.cp-dm-picker-footer {
	padding: 10px 14px 14px;
	border-top: 1px solid #efefef;
	display: flex;
	gap: 8px;
	align-items: center;
}

.cp-dm-picker-footer input {
	flex: 1;
	border: 1px solid #dbdbdb;
	border-radius: 10px;
	padding: 8px 11px;
	font-size: 13.5px;
}

/* Mobile Stacked Inbox / Thread Switching */
@media (max-width: 1023px) {
	.cp-dm-page-wrap {
		padding: 0;
	}
	.cp-dm-shell {
		grid-template-columns: 1fr;
		height: calc(100dvh - 58px);
		min-height: calc(100dvh - 58px);
		border-radius: 0;
		border: 0;
	}
	.cp-dm-shell[data-view="inbox"] .cp-dm-chat-pane {
		display: none;
	}
	.cp-dm-shell[data-view="thread"] .cp-dm-inbox-pane {
		display: none;
	}
	.cp-dm-back-btn {
		display: inline-flex;
	}
}

/* Dark Mode Overrides for P2P Messaging */
body.cp-dark .cp-dm-shell,
body.cp-dark .cp-dm-chat-pane,
body.cp-dark .cp-dm-composer-wrap,
body.cp-dark .cp-dm-gate-card,
body.cp-dark .cp-dm-post-card,
body.cp-dark .cp-dm-post-card .cp-ig-post-head,
body.cp-dark .cp-dm-post-card .cp-ig-post-caption,
body.cp-dark .cp-dm-action-menu,
body.cp-dark .cp-dm-action-row,
body.cp-dark .cp-dm-picker-sheet,
body.cp-dark .cp-dm-picker-row {
	background: #121212;
	border-color: #262626;
	color: #f5f5f5;
}
body.cp-dark .cp-dm-inbox-pane,
body.cp-dark .cp-dm-chat-header,
body.cp-dark .cp-dm-action-row,
body.cp-dark .cp-dm-action-time,
body.cp-dark .cp-dm-picker-header,
body.cp-dark .cp-dm-picker-footer,
body.cp-dark .cp-dm-post-card .cp-ig-post-caption {
	border-color: #262626;
}
body.cp-dark .cp-dm-owner-title,
body.cp-dark .cp-dm-thread-top,
body.cp-dark .cp-dm-thread-row.is-unread .cp-dm-thread-sub,
body.cp-dark .cp-dm-icon-btn,
body.cp-dark .cp-dm-back-btn,
body.cp-dark .cp-dm-picker-header h3,
body.cp-dark .cp-dm-picker-meta strong {
	color: #f5f5f5;
}
body.cp-dark .cp-dm-thread-sub,
body.cp-dark .cp-dm-peer-meta small,
body.cp-dark .cp-dm-receipt,
body.cp-dark .cp-dm-empty-note,
body.cp-dark .cp-dm-empty-box,
body.cp-dark .cp-dm-placeholder p,
body.cp-dark .cp-dm-action-time,
body.cp-dark .cp-dm-picker-close,
body.cp-dark .cp-dm-picker-meta small {
	color: #a1a1aa;
}
body.cp-dark .cp-dm-search-bar,
body.cp-dark .cp-dm-picker-search,
body.cp-dark .cp-dm-bubble.is-text-bubble,
body.cp-dark .cp-dm-reaction-bar,
body.cp-dark .cp-dm-reaction-badge,
body.cp-dark .cp-dm-thread-row.is-active {
	background: #262626;
	border-color: #363636;
	color: #f5f5f5;
}
body.cp-dark .cp-dm-thread-row:hover,
body.cp-dark .cp-dm-icon-btn:hover,
body.cp-dark .cp-dm-action-row:hover,
body.cp-dark .cp-dm-picker-row:hover {
	background: #1e1e1e;
}
body.cp-dark .cp-dm-picker-row.is-selected {
	background: #0f2136;
}
body.cp-dark .cp-dm-search-bar input,
body.cp-dark .cp-dm-picker-search input,
body.cp-dark .cp-dm-composer-form textarea {
	color: #f5f5f5;
	background: transparent;
}
body.cp-dark .cp-dm-composer-form,
body.cp-dark .cp-dm-picker-footer input {
	background: #1a1a1a;
	border-color: #333333;
	color: #f5f5f5;
}
body.cp-dark .cp-dm-quick-btn {
	background: #1e1e1e;
	border-color: #333333;
	color: #f5f5f5;
}
body.cp-dark .cp-dm-quick-btn:hover {
	background: #2e2e2e;
}
body.cp-dark .cp-dm-reply-quote,
body.cp-dark .cp-dm-reply-bar {
	background: #182232;
	border-left-color: #38bdf8;
	color: #e2e8f0;
}
body.cp-dark .cp-dm-reply-copy span,
body.cp-dark .cp-dm-react-chip small {
	color: #cbd5e1;
}
body.cp-dark .cp-dm-avatar {
	border-color: #121212;
}
body.cp-dark .cp-dm-gate-icon {
	border-color: #52525b;
	color: #f5f5f5;
}
body.cp-dark .cp-dm-action-row.is-danger {
	color: #f87171;
}

.cp-dm-select-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 8px 16px;
	background: #fafafa;
	border-bottom: 1px solid #efefef;
	font-size: 13px;
	font-weight: 600;
}
.cp-dm-select-actions {
	display: flex;
	gap: 8px;
}
.cp-dm-del-btn {
	border: 0;
	background: #ed4956;
	color: #fff;
	font-size: 12.5px;
	font-weight: 700;
	padding: 5px 12px;
	border-radius: 8px;
	cursor: pointer;
}
.cp-dm-del-btn:disabled {
	opacity: 0.45;
	cursor: default;
}
.cp-dm-cancel-sel-btn {
	border: 1px solid #dbdbdb;
	background: transparent;
	color: inherit;
	font-size: 12.5px;
	font-weight: 600;
	padding: 5px 10px;
	border-radius: 8px;
	cursor: pointer;
}
.cp-dm-thread-check {
	width: 22px;
	height: 22px;
	border-radius: 50%;
	border: 1.8px solid #a1a1aa;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 22px;
	font-size: 12px;
	font-weight: 700;
}
.cp-dm-thread-check.is-checked {
	background: #0095f6;
	border-color: #0095f6;
	color: #fff;
}
body.cp-dark .cp-dm-select-bar {
	background: #141414;
	border-color: #262626;
}
body.cp-dark .cp-dm-cancel-sel-btn {
	border-color: #333;
}
