:root {
	--sp-st-bg: #f5f7fb;
	--sp-st-surface: #ffffff;
	--sp-st-surface-soft: #f8fafc;
	--sp-st-text: #1f2937;
	--sp-st-muted: #667085;
	--sp-st-border: #e4e7ec;
	--sp-st-accent: #355c88;
	--sp-st-accent-strong: #2c4e74;
	--sp-st-accent-soft: #eef4fb;

	--sp-st-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
	--sp-st-shadow-soft: 0 6px 18px rgba(15, 23, 42, 0.05);

	--sp-st-radius: 18px;
	--sp-st-radius-sm: 14px;
}

/* =========================================================
   SmartTheme layout integration
   ========================================================= */

.sp-st-layout {
	margin-top: 0.35rem;
}

.sp-st-centre {
	min-width: 0;
}

.sp-st-sidebar {
	min-width: 0;
}

.sp-st-sidebar--left,
.sp-st-sidebar--right {
	align-self: start;
}

/* =========================================================
   Centre tools stack
   ========================================================= */

.sp-st-centre-tools {
	margin: 0 0 0.85rem;
}

/* =========================================================
   SmartPreview hero
   ========================================================= */

.sp-st-hero {
	background: var(--sp-st-surface);
	border: 1px solid var(--sp-st-border);
	border-radius: var(--sp-st-radius);
	box-shadow: var(--sp-st-shadow-soft);
	padding: 0.95rem 1rem;
	margin: 0 0 0.8rem;
}

.sp-st-hero-title {
	margin: 0;
	font-size: 1.04rem;
	font-weight: 700;
	line-height: 1.3;
	letter-spacing: -0.01em;
	color: var(--sp-st-text);
}

.sp-st-hero-text {
	margin: 0.3rem 0 0;
	color: var(--sp-st-muted);
	font-size: 0.93rem;
	line-height: 1.5;
}

.sp-st-hero-actions {
	margin-top: 0.75rem;
}

.sp-st-start-button,
.sp-st-start-button:link,
.sp-st-start-button:visited {
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
	min-height: 44px;
	padding: 0.75rem 1rem;
	border: 0;
	border-radius: var(--sp-st-radius-sm);
	background: var(--sp-st-accent);
	color: #ffffff;
	font-weight: 700;
	font-size: 0.96rem;
	line-height: 1.2;
	text-decoration: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.45rem;
	box-shadow: 0 8px 20px rgba(53, 92, 136, 0.16);
	transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.sp-st-start-button:hover,
.sp-st-start-button:focus {
	background: var(--sp-st-accent-strong);
	color: #ffffff;
	text-decoration: none;
	box-shadow: 0 10px 24px rgba(53, 92, 136, 0.19);
	transform: translateY(-1px);
}

.sp-st-start-button span,
.sp-st-start-button i,
.sp-st-start-button:link span,
.sp-st-start-button:visited span,
.sp-st-start-button:hover span,
.sp-st-start-button:focus span,
.sp-st-start-button:hover i,
.sp-st-start-button:focus i {
	color: #ffffff;
	text-shadow: none;
	background-image: none;
}

.sp-st-start-button,
.sp-st-start-button:hover,
.sp-st-start-button:focus {
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

/* =========================================================
   Feed wrapper
   ========================================================= */

.recent-feed.sp-st-feed {
	width: 100%;
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

.recent-feed.sp-st-feed .topic-item,
.recent-feed .topic-item.sp-st-topic-item {
	background: var(--sp-st-surface);
	border: 1px solid var(--sp-st-border);
	border-radius: var(--sp-st-radius);
	padding: 0.95rem 1rem;
	margin: 0 0 0.85rem;
	box-shadow: var(--sp-st-shadow-soft);
	transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.recent-feed.sp-st-feed .topic-item:hover,
.recent-feed .topic-item.sp-st-topic-item:hover {
	background: var(--sp-st-surface-soft);
	border-color: #d5dbe3;
	transform: translateY(-1px);
	box-shadow: var(--sp-st-shadow);
}

/* =========================================================
   Unread emphasis
   ========================================================= */

.recent-feed .topic-item.sp-st-topic-item.unread {
	border-color: #d8e2ee;
}

.recent-feed .topic-item .first-post.sp-st-first-post.unread,
.recent-feed .topic-item .reply-snippet.sp-st-reply-snippet.unread {
	background: #fcfdff;
}

.smartpreview-marker.unread-label,
.recent-feed .unread-label {
	color: var(--sp-st-accent);
}

/* =========================================================
   Feed card header
   ========================================================= */

.recent-feed .topic-item .topic-meta.sp-st-topic-meta {
	display: flex;
	align-items: flex-start;
	gap: 0.8rem;
	margin-bottom: 0.65rem;
}

.recent-feed .topic-item .avatar.sp-st-avatar-wrap {
	flex-shrink: 0;
}

.recent-feed .topic-item .avatar.sp-st-avatar-wrap img,
.recent-feed .topic-item .avatar.sp-st-avatar-wrap .avatar img {
	width: 48px;
	height: 48px;
	border-radius: 999px;
	object-fit: cover;
	display: block;
}

.recent-feed .topic-item .title-block.sp-st-title-block {
	min-width: 0;
	flex: 1 1 auto;
}

.recent-feed .topic-item .username.sp-st-username {
	font-size: 0.95rem;
	font-weight: 600;
	color: var(--sp-st-text);
	margin-bottom: 0.15rem;
}

.recent-feed .topic-item .title-line.sp-st-title-line {
	display: flex;
	align-items: flex-start;
	flex-wrap: nowrap;
	gap: 0.45rem;
	min-width: 0;
}

.recent-feed .topic-item .title-line.sp-st-title-line .smartpreview-marker {
	flex: 0 0 auto;
	margin-top: 0.08rem;
}

.recent-feed .topic-item .topic-title.sp-st-topic-title,
.recent-feed .topic-item .topic-title.sp-st-topic-title:link,
.recent-feed .topic-item .topic-title.sp-st-topic-title:visited {
	display: block;
	min-width: 0;
	flex: 1 1 auto;
	font-size: 1.08rem;
	font-weight: 700;
	line-height: 1.3;
	letter-spacing: -0.01em;
	text-decoration: none;
	color: var(--sp-st-text);
	word-break: break-word;
	overflow-wrap: anywhere;
}

.recent-feed .topic-item .topic-title.sp-st-topic-title:hover,
.recent-feed .topic-item .topic-title.sp-st-topic-title:focus {
	color: var(--sp-st-accent);
	text-decoration: none;
}

.recent-feed .topic-item .byline.sp-st-byline {
	margin-top: 0.16rem;
	color: var(--sp-st-muted);
	font-size: 0.9rem;
	line-height: 1.45;
}

/* =========================================================
   First post block
   ========================================================= */

.recent-feed .topic-item .first-post.sp-st-first-post {
	margin-top: 0;
	color: var(--sp-st-text);
	line-height: 1.6;
}

.recent-feed .topic-item .first-post.sp-st-first-post a {
	color: inherit;
	text-decoration: none;
}

.recent-feed .topic-item .first-post.sp-st-first-post a.show-more {
	color: var(--sp-st-accent);
	font-weight: 600;
}

.recent-feed .topic-item .first-post.sp-st-first-post a.show-more:hover,
.recent-feed .topic-item .first-post.sp-st-first-post a.show-more:focus {
	color: var(--sp-st-accent-strong);
	text-decoration: underline;
}

/* =========================================================
   Stats row
   ========================================================= */

.recent-feed .topic-item .topic-stats.sp-st-topic-stats {
	display: flex;
	flex-wrap: wrap;
	gap: 0.55rem 0.95rem;
	align-items: center;
	margin-top: 0.75rem;
	color: var(--sp-st-muted);
	font-size: 0.9rem;
	padding-top: 0.1rem;
}

.recent-feed .topic-item .topic-stats .stat {
	display: inline-flex;
	align-items: center;
	gap: 0.3rem;
	white-space: nowrap;
}

.recent-feed .topic-item .topic-stats .stat-value {
	font-weight: 700;
	color: var(--sp-st-text);
}

.recent-feed .topic-item .topic-stats .stat-label {
	color: var(--sp-st-muted);
}

.recent-feed .topic-item .topic-stats .stat-label-short {
	display: none;
}

.recent-feed .topic-item .topic-stats .stat-label-full {
	display: inline;
}

.recent-feed .topic-item .topic-stats .stat-unread,
.recent-feed .topic-item .topic-stats .stat-unread .stat-value,
.recent-feed .topic-item .topic-stats .stat-unread .stat-label,
.recent-feed .topic-item .topic-stats .stat-unread i {
	color: var(--st-success) !important;
}

.recent-feed .topic-item .topic-stats .stat-unread {
	font-weight: 600;
}
/* =========================================================
   Reply block
   ========================================================= */

.recent-feed .topic-item .reply-snippet.sp-st-reply-snippet {
	margin-top: 0.8rem;
	padding: 0.8rem 0 0 1.15rem;
	border-top: 1px solid #edf1f5;
	background: transparent;
	border-radius: 0;
}

.recent-feed .topic-item .reply-meta.sp-st-reply-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.35rem;
	color: var(--sp-st-muted);
	font-size: 0.92rem;
	margin-bottom: 0.35rem;
}

.recent-feed .topic-item .reply-text.sp-st-reply-text {
	color: var(--sp-st-text);
	line-height: 1.6;
	padding-left: 1.2rem;
}

.recent-feed .topic-item .reply-meta.sp-st-reply-meta a:hover,
.recent-feed .topic-item .reply-meta.sp-st-reply-meta a:focus {
	color: var(--sp-st-accent);
	text-decoration: none;
}

.sp-st-reply-label {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-weight: 700;
	color: var(--sp-st-muted);
}

.recent-feed .topic-item .reply-text.sp-st-reply-text {
	color: var(--sp-st-text);
	line-height: 1.6;
	padding-left: 1.15rem;
}

.recent-feed .topic-item .reply-text.sp-st-reply-text a {
	color: inherit;
	text-decoration: none;
}

.recent-feed .topic-item .reply-text.sp-st-reply-text a.show-more {
	color: var(--sp-st-accent);
	font-weight: 600;
}

.recent-feed .topic-item .reply-text.sp-st-reply-text a.show-more:hover,
.recent-feed .topic-item .reply-text.sp-st-reply-text a.show-more:focus {
	color: var(--sp-st-accent-strong);
	text-decoration: underline;
}

/* =========================================================
   Thumbnails
   ========================================================= */

.recent-feed .preview-thumb {
	display: table;
	margin: 0 0 0.75rem;
	position: relative;
	width: auto;
	max-width: 100%;
	overflow: hidden;
}

.recent-feed .preview-thumb img {
	display: block;
	max-width: 100%;
	height: auto;
	border-radius: 12px;
}

.recent-feed .preview-thumb-more {
	position: absolute;
	right: 0.55rem;
	bottom: 0.55rem;
	min-width: 28px;
	height: 28px;
	padding: 0 0.55rem;
	border-radius: 999px;
	background: rgba(15, 23, 42, 0.74);
	color: #ffffff;
	font-size: 0.82rem;
	font-weight: 700;
	line-height: 1;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

/* =========================================================
   Quotes
   ========================================================= */

.recent-feed .first-post blockquote,
.recent-feed .reply-text blockquote {
	margin: 0.6rem 0 0;
	padding: 0.75rem 0.9rem;
	background: #f8fafc;
	border: 1px solid #e8edf3;
	border-left: 4px solid #cfd9e5;
	border-radius: 12px;
	color: var(--sp-st-muted);
}

/* =========================================================
   Load more
   ========================================================= */

.sp-st-load-more-wrap,
.load-more.sp-st-load-more-wrap {
	margin-top: 1rem;
}

.sp-st-load-more-button,
.load-more .sp-st-load-more-button,
.sp-st-load-more-button:link,
.load-more .sp-st-load-more-button:link,
.sp-st-load-more-button:visited,
.load-more .sp-st-load-more-button:visited {
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
	min-height: 48px;
	padding: 0.85rem 1rem;
	border: 0;
	border-radius: var(--sp-st-radius-sm);
	background: var(--sp-st-accent);
	color: #ffffff !important;
	font-weight: 700;
	font-size: 0.96rem;
	line-height: 1.2;
	text-decoration: none !important;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.4rem;
	box-shadow: 0 8px 20px rgba(53, 92, 136, 0.16);
	transition: background 0.2s ease, box-shadow 0.2s ease;
	transform: none !important;
	background-image: none !important;
	text-shadow: none !important;
}

.sp-st-load-more-button:hover,
.load-more .sp-st-load-more-button:hover,
.sp-st-load-more-button:focus,
.load-more .sp-st-load-more-button:focus {
	background: var(--sp-st-accent-strong);
	color: #ffffff !important;
	text-decoration: none !important;
	box-shadow: 0 10px 24px rgba(53, 92, 136, 0.19);
	transform: none !important;
	background-image: none !important;
	text-shadow: none !important;
}

.sp-st-load-more-button span,
.sp-st-load-more-button i,
.sp-st-load-more-button:hover span,
.sp-st-load-more-button:hover i,
.sp-st-load-more-button:focus span,
.sp-st-load-more-button:focus i {
	color: #ffffff !important;
	text-shadow: none !important;
	background-image: none !important;
}
/* =========================================================
   Hide non-SmartTheme SmartPreview desktop sidebar remnants
   ========================================================= */

.sp-layout--with-sidebar .sp-desktop-sidebar,
.sp-top-dock,
.sp-avatar-nav-backdrop,
.sp-avatar-nav-panel,
.sp-right-nav-panel {
	display: none !important;
}

/* =========================================================
   Sitewide tabs / index helpers kept for compatibility
   ========================================================= */

.sp-tabs-wrap--smarttheme {
	margin: 0 auto 0.7rem;
	padding: 0 1rem;
}

.sp-tabs-wrap--smarttheme .sp-view-tabs {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0.45rem;
	padding: 0.35rem;
	background: var(--sp-st-surface-soft);
	border: 1px solid var(--sp-st-border);
	border-radius: var(--sp-st-radius);
	box-shadow: var(--sp-st-shadow-soft);
}

.sp-tabs-wrap--smarttheme .sp-view-tabs.sp-view-tabs--with-context {
	grid-template-columns: repeat(3, minmax(0, 1fr));
}

.sp-tabs-wrap--smarttheme .sp-view-tabs a,
.sp-tabs-wrap--smarttheme .sp-view-tabs [data-smartpreview-context-tab="1"] {
	min-height: 44px;
	padding: 0 1rem;
	border-radius: 999px;
	font-weight: 700;
	font-size: 0.95rem;
	text-decoration: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: transparent;
	border: 1px solid transparent;
	color: var(--sp-st-accent);
	transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.sp-tabs-wrap--smarttheme .sp-view-tabs a:hover {
	background: var(--sp-st-accent-soft);
	border-color: transparent;
	color: var(--sp-st-accent-strong);
}

.sp-tabs-wrap--smarttheme .sp-view-tabs a.active,
.sp-tabs-wrap--smarttheme .sp-view-tabs [data-smartpreview-context-tab="1"].active {
	background: var(--sp-st-accent);
	border-color: var(--sp-st-accent);
	color: #ffffff;
	box-shadow: 0 6px 14px rgba(53, 92, 136, 0.16);
}

.sp-tabs-wrap--smarttheme .sp-view-tabs a.active:hover {
	background: var(--sp-st-accent-strong);
	border-color: var(--sp-st-accent-strong);
	color: #ffffff;
}

.sp-st-hero--index {
	margin: 0 auto 0.75rem;
}

.sp-start-conversation-wrap--index {
	margin: 0 auto 0.75rem;
}

.sp-start-conversation-wrap--index .sp-start-conversation-button,
.sp-start-conversation-wrap--index .sp-start-conversation-button:link,
.sp-start-conversation-wrap--index .sp-start-conversation-button:visited {
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
	min-height: 44px;
	padding: 0.75rem 1rem;
	border: 0;
	border-radius: var(--sp-st-radius-sm);
	background: var(--sp-st-accent);
	color: #ffffff;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.45rem;
	font-weight: 700;
	font-size: 0.96rem;
	line-height: 1.2;
	text-decoration: none;
	box-shadow: 0 8px 20px rgba(53, 92, 136, 0.16);
	transition: background 0.2s ease, box-shadow 0.2s ease;
}

.sp-start-conversation-wrap--index .sp-start-conversation-button:hover,
.sp-start-conversation-wrap--index .sp-start-conversation-button:focus {
	background: var(--sp-st-accent-strong);
	color: #ffffff;
	text-decoration: none;
	box-shadow: 0 10px 24px rgba(53, 92, 136, 0.19);
}

.sp-start-conversation-wrap--index .sp-start-conversation-button span,
.sp-start-conversation-wrap--index .sp-start-conversation-button i,
.sp-start-conversation-wrap--index .sp-start-conversation-button:link span,
.sp-start-conversation-wrap--index .sp-start-conversation-button:visited span,
.sp-start-conversation-wrap--index .sp-start-conversation-button:hover span,
.sp-start-conversation-wrap--index .sp-start-conversation-button:focus span,
.sp-start-conversation-wrap--index .sp-start-conversation-button:hover i,
.sp-start-conversation-wrap--index .sp-start-conversation-button:focus i {
	color: #ffffff;
	text-shadow: none;
	background-image: none;
}

.sp-tabs-wrap--smarttheme + .sp-start-conversation-wrap--index,
.sp-tabs-wrap--smarttheme + .sp-st-hero--index,
.sp-st-hero--index + .sp-start-conversation-wrap--index {
	margin-top: -0.05rem;
}

/* =========================================================
   Mobile
   ========================================================= */

@media (max-width: 1100px) {
	.sp-st-layout {
		grid-template-columns: minmax(0, 1fr);
	}

	.sp-st-sidebar--left,
	.sp-st-sidebar--right {
		display: none;
	}
}

@media (max-width: 760px) {
	.recent-feed .topic-item .topic-stats .stat-label-short {
		display: inline;
	}

	.recent-feed .topic-item .topic-stats .stat-label-full {
		display: none;
	}

	.recent-feed .topic-item .reply-snippet.sp-st-reply-snippet {
		padding-left: 0.35rem;
	}

	.recent-feed .topic-item .reply-text.sp-st-reply-text {
		padding-left: 0.75rem;
	}

	.recent-feed .preview-thumb {
		display: table;
		max-width: 100%;
		overflow: hidden;
	}

	.recent-feed .preview-thumb img {
		width: auto;
		max-width: 100%;
		max-height: 96px;
	}

	.recent-feed .preview-thumb-more {
		right: 0.4rem;
		bottom: 0.4rem;
	}
}

@media (max-width: 560px) {
	.sp-st-centre-tools {
		margin-bottom: 0.72rem;
	}

	.sp-st-hero {
		padding: 0.9rem;
		margin-bottom: 0.72rem;
	}

	.sp-st-hero-title {
		font-size: 1rem;
	}

	.recent-feed.sp-st-feed .topic-item,
	.recent-feed .topic-item.sp-st-topic-item {
		padding: 0.9rem;
		margin-bottom: 0.75rem;
	}

	.recent-feed .topic-item .topic-meta.sp-st-topic-meta {
		gap: 0.68rem;
	}

	.recent-feed .topic-item .avatar.sp-st-avatar-wrap img,
	.recent-feed .topic-item .avatar.sp-st-avatar-wrap .avatar img {
		width: 42px;
		height: 42px;
	}

	.recent-feed .topic-item .topic-title.sp-st-topic-title,
	.recent-feed .topic-item .topic-title.sp-st-topic-title:link,
	.recent-feed .topic-item .topic-title.sp-st-topic-title:visited {
		font-size: 1rem;
	}

	.recent-feed .topic-item .topic-stats.sp-st-topic-stats {
		gap: 0.5rem 0.8rem;
		font-size: 0.88rem;
	}
}

.recent-feed .topic-item .reply-snippet.sp-st-reply-snippet.unread {
	background: #f7fbff;
	border-top-color: #d9e8f7;
}

.recent-feed .topic-item .reply-snippet.sp-st-reply-snippet.unread .reply-meta.sp-st-reply-meta {
	color: var(--sp-st-accent);
}

.recent-feed .topic-item .reply-snippet.sp-st-reply-snippet.unread .sp-st-reply-label {
	color: var(--sp-st-accent);
}

.recent-feed .topic-item .reply-snippet.sp-st-reply-snippet.unread .smartpreview-marker i {
	color: var(--sp-st-accent);
}

.sp-loading-indicator {
	position: fixed;
	inset: 0;
	display: none;
	align-items: center;
	justify-content: center;
	background: rgba(245, 247, 251, 0.72);
	z-index: 9999;
	pointer-events: none;
}

.sp-loading-indicator.is-active,
.sp-loading-indicator[data-sp-visible="1"] {
	display: flex;
}

.sp-loading-indicator .icon {
	font-size: 1.9rem;
	color: var(--sp-st-accent);
}

.sp-back-to-top {
	position: fixed !important;
	right: 1rem !important;
	bottom: 1rem !important;
	left: auto !important;
	top: auto !important;
	width: 46px;
	height: 46px;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: var(--sp-st-accent);
	color: #ffffff !important;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 10px 24px rgba(53, 92, 136, 0.22);
	cursor: pointer;
	z-index: 9998;
	text-decoration: none;
	background-image: none !important;
	text-shadow: none !important;
}

.sp-back-to-top:hover,
.sp-back-to-top:focus {
	background: var(--sp-st-accent-strong);
	color: #ffffff !important;
	background-image: none !important;
	text-shadow: none !important;
}

.sp-back-to-top i,
.sp-back-to-top .icon {
	color: #ffffff !important;
	font-size: 1rem;
	line-height: 1;
	position: static !important;
	margin: 0 !important;
}

/* Opening topic unread envelope */
.recent-feed .topic-item.sp-st-topic-item.unread .title-line .smartpreview-marker i,
.recent-feed .topic-item.sp-st-topic-item .first-post.sp-st-first-post.unread ~ .topic-stats,
.recent-feed .topic-item.sp-st-topic-item .smartpreview-marker-topic.unread-label i {
	color: var(--st-success) !important;
}

/* Reply unread envelope + reply arrow */
.recent-feed .topic-item .reply-snippet.sp-st-reply-snippet.unread .smartpreview-marker i,
.recent-feed .topic-item .reply-snippet.sp-st-reply-snippet.unread .sp-st-reply-label {
	color: var(--st-success) !important;
}

.recent-feed .topic-item .smartpreview-marker-topic.unread-label,
.recent-feed .topic-item .smartpreview-marker-reply.unread-label,
.recent-feed .topic-item .reply-snippet.sp-st-reply-snippet.unread .sp-st-reply-label {
	color: var(--st-success) !important;
}

.smarttheme-index-layout {
	align-items: start;
}

.smarttheme-index-sidebar--left,
.smarttheme-index-sidebar--right {
	align-self: start;
	position: relative;
}

.smarttheme-index-sidebar--left .smarttheme-sidebar-shell {
	position: sticky;
	top: 1rem;
}
