/* Shinsei Recent Topics 0.2.1 */

/* Hide the previous Recent Topics extension block when it is still enabled. */
#recenttopics-bottom {
	display: none !important;
}

.shinsei-rt {
	--srt-accent: #d97c63;
	--srt-accent-soft: rgba(217, 124, 99, 0.13);
	--srt-panel: rgba(24, 22, 20, 0.96);
	--srt-panel-2: rgba(18, 17, 15, 0.92);
	--srt-border: rgba(255, 255, 255, 0.09);
	--srt-muted: rgba(214, 205, 197, 0.58);
	--srt-text: rgba(244, 239, 234, 0.94);

	margin: 18px 0 22px;
	padding: 12px;
	overflow: hidden;
	border: 1px solid rgba(0, 0, 0, 0.78);
	border-radius: 11px;
	background: var(--srt-panel);
	box-shadow:
		inset 0 1px 0 rgba(255, 255, 255, 0.08),
		0 10px 28px rgba(0, 0, 0, 0.26);
	color: var(--srt-text);
}

.shinsei-rt__tabs {
	display: flex;
	gap: 6px;
	padding: 0 0 12px;
	overflow-x: auto;
	scrollbar-width: none;
}

.shinsei-rt__tabs::-webkit-scrollbar {
	display: none;
}

.shinsei-rt__tab {
	flex: 0 0 auto;
	padding: 8px 12px;
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: 7px;
	background: rgba(14, 13, 12, 0.54);
	color: rgba(226, 219, 212, 0.62);
	font: inherit;
	font-size: 12.35px;
	font-weight: 650;
	line-height: 1;
	cursor: pointer;
	transition:
		border-color 150ms ease,
		background-color 150ms ease,
		color 150ms ease;
}

.shinsei-rt__tab:hover {
	border-color: rgba(217, 124, 99, 0.28);
	color: rgba(244, 239, 234, 0.88);
}

.shinsei-rt__tab.is-active {
	border-color: rgba(217, 124, 99, 0.45);
	background: rgba(217, 124, 99, 0.17);
	color: #f4e7df;
}

.shinsei-rt__tab:focus-visible,
.shinsei-rt__first-post:focus-visible,
.shinsei-rt__page:focus-visible {
	outline: 2px solid rgba(217, 124, 99, 0.58);
	outline-offset: 2px;
}

.shinsei-rt__panels {
	overflow: hidden;
	border: 1px solid var(--srt-border);
	border-radius: 9px;
	background: var(--srt-panel-2);
}

.shinsei-rt__panel[hidden] {
	display: none !important;
}

.shinsei-rt__row {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto minmax(150px, 210px);
	align-items: center;
	gap: 17px;
	min-height: 68px;
	padding: 11px 14px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.075);
	transition: background-color 140ms ease;
}

.shinsei-rt__row:hover {
	background: rgba(255, 255, 255, 0.025);
}

.shinsei-rt__main {
	min-width: 0;
}

.shinsei-rt__title-line {
	display: flex;
	align-items: center;
	gap: 5px;
	min-width: 0;
}

.shinsei-rt__topic-title {
	display: block;
	min-width: 0;
	overflow: hidden;
	color: rgba(244, 239, 234, 0.93) !important;
	font-size: 13px;
	font-weight: 700;
	line-height: 1.3;
	text-overflow: ellipsis;
	white-space: nowrap;
	text-decoration: none !important;
}

.shinsei-rt__topic-title:hover {
	color: #fff !important;
}

/* Minimal first-post shortcut: no square, no border, no background. */
.shinsei-rt__first-post {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 22px;
	height: 22px;
	flex: 0 0 22px;
	padding: 0;
	border: 0;
	background: transparent;
	color: rgba(228, 218, 210, 0.38) !important;
	opacity: 0.62;
	text-decoration: none !important;
	transition: color 140ms ease, opacity 140ms ease, transform 140ms ease;
}

.shinsei-rt__first-post:hover {
	color: var(--srt-accent) !important;
	opacity: 1;
	transform: translateX(-1px);
}

.shinsei-rt__first-post svg {
	width: 15px;
	height: 15px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.8;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.shinsei-rt__topic-meta {
	display: flex;
	align-items: center;
	gap: 5px;
	min-width: 0;
	margin-top: 4px;
	overflow: hidden;
	color: var(--srt-muted);
	font-size: 10.85px;
	line-height: 1.3;
	white-space: nowrap;
}

.shinsei-rt__topic-meta > * {
	flex: 0 0 auto;
}

.shinsei-rt__topic-meta a {
	color: rgba(217, 124, 99, 0.78);
	text-decoration: none;
}

.shinsei-rt__topic-meta a:hover {
	color: var(--srt-accent);
}

.shinsei-rt__metrics {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 4px;
	color: rgba(213, 205, 198, 0.48);
	font-size: 10.35px;
	line-height: 1.15;
	white-space: nowrap;
}

.shinsei-rt__last {
	display: grid;
	grid-template-columns: 1fr;
	justify-items: end;
	min-width: 0;
	color: var(--srt-muted);
	font-size: 10.85px;
	line-height: 1.3;
	text-align: right;
}

.shinsei-rt__last-label {
	color: rgba(217, 124, 99, 0.66);
	font-size: 9.35px;
	font-weight: 800;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.shinsei-rt__last-user {
	display: block;
	max-width: 100%;
	overflow: hidden;
	margin-top: 2px;
	color: rgba(242, 236, 230, 0.82);
	font-size: 11px;
	font-weight: 650;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.shinsei-rt__last-user a {
	text-decoration: none;
}

.shinsei-rt__last time {
	display: block;
	margin-top: 1px;
	overflow: hidden;
	max-width: 100%;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* Independent pager displayed at the bottom of each tab. */
.shinsei-rt__pagination {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-wrap: wrap;
	gap: 5px;
	min-height: 52px;
	padding: 10px 12px;
	border-top: 1px solid rgba(255, 255, 255, 0.075);
	background: rgba(255, 255, 255, 0.012);
}

.shinsei-rt__page {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 30px;
	height: 30px;
	padding: 0 9px;
	border: 1px solid rgba(255, 255, 255, 0.075);
	border-radius: 8px;
	background: rgba(12, 11, 10, 0.5);
	color: rgba(224, 216, 208, 0.58) !important;
	font-size: 10px;
	font-weight: 700;
	line-height: 1;
	text-decoration: none !important;
	transition:
		border-color 140ms ease,
		background-color 140ms ease,
		color 140ms ease;
}

a.shinsei-rt__page:hover {
	border-color: rgba(217, 124, 99, 0.38);
	background: rgba(217, 124, 99, 0.1);
	color: rgba(244, 235, 228, 0.94) !important;
}

.shinsei-rt__page.is-current {
	border-color: rgba(217, 124, 99, 0.5);
	background: rgba(217, 124, 99, 0.18);
	color: #fff !important;
}

.shinsei-rt__page--ellipsis {
	min-width: 22px;
	padding: 0 3px;
	border-color: transparent;
	background: transparent;
	color: rgba(224, 216, 208, 0.34) !important;
}

.shinsei-rt__empty {
	margin: 0;
	padding: 28px 16px;
	color: var(--srt-muted);
	font-size: 11px;
	text-align: center;
}

/* Zeina custom rules can be aggressive; preserve the widget's own surfaces. */
#page-body .shinsei-rt,
#page-body .shinsei-rt__panels {
	box-sizing: border-box;
}

@media (max-width: 900px) {
	.shinsei-rt__row {
		grid-template-columns: minmax(0, 1fr) minmax(125px, 165px);
		gap: 12px;
	}

	.shinsei-rt__metrics {
		display: none;
	}
}

@media (max-width: 620px) {
	.shinsei-rt {
		margin-top: 14px;
		padding: 9px;
		border-radius: 9px;
	}

	.shinsei-rt__tab {
		padding: 8px 10px;
		font-size: 10px;
	}

	.shinsei-rt__row {
		grid-template-columns: 1fr;
		gap: 7px;
		padding: 11px 12px;
	}

	.shinsei-rt__last {
		display: flex;
		align-items: center;
		justify-content: flex-start;
		gap: 6px;
		text-align: left;
	}

	.shinsei-rt__last-label {
		display: none;
	}

	.shinsei-rt__last-user {
		margin-top: 0;
		font-size: 10.85px;
	}

	.shinsei-rt__last time {
		margin-top: 0;
	}

	.shinsei-rt__topic-meta {
		flex-wrap: wrap;
		white-space: normal;
	}

	.shinsei-rt__pagination {
		min-height: 47px;
		padding: 8px;
	}

	.shinsei-rt__page {
		min-width: 28px;
		height: 28px;
		padding: 0 8px;
	}
}
