/* ── Variables ───────────────────────────────────────────────────────────── */
:root {
	--clr-bg:              #f2f3f6;
	--clr-surface:         #ffffff;
	--clr-surface-alt:     #f7f8fa;
	--clr-border:          #d8dce8;
	--clr-text:            #1c1e2b;
	--clr-text-muted:      #6b7280;
	--clr-link:            #2e60c8;
	--clr-link-hover:      #1e48a0;

	--clr-header-bg:       #14172a;
	--clr-header-text:     #e6e9f4;
	--clr-header-link:     #b8c0d8;
	--clr-header-link-hover: #ffffff;

	--clr-danger:          #b03328;
	--clr-danger-bg:       #fdf2f1;
	--clr-danger-border:   #f5c4bf;
	--clr-warning:         #b85c10;
	--clr-warning-bg:      #fef7ec;
	--clr-warning-border:  #f5c88a;
	--clr-success:         #1e7e44;
	--clr-success-bg:      #f0faf4;
	--clr-success-border:  #a3d9b4;

	--clr-badge-pending:   #c07810;
	--clr-badge-pending-bg: #fff4d6;
	--clr-badge-detected:  #a82020;
	--clr-badge-detected-bg: #ffe8e8;
	--clr-badge-mod-author-bg: #2e60c8;

	--clr-notification:    #c0392b;

	--radius:    4px;
	--radius-lg: 8px;
	--shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
	--shadow-md: 0 2px 8px rgba(0,0,0,0.12);

	--content-width: 1000px;
	--header-height: 48px;
}

@media (prefers-color-scheme: dark) {
	:root {
		--clr-bg:              #10121c;
		--clr-surface:         #191c2a;
		--clr-surface-alt:     #212538;
		--clr-border:          #2c3050;
		--clr-text:            #dde0f0;
		--clr-text-muted:      #8890b0;
		--clr-link:            #7aacff;
		--clr-link-hover:      #a6c8ff;

		--clr-header-bg:       #0a0c14;
		--clr-header-text:     #dde0f0;
		--clr-header-link:     #9098b8;
		--clr-header-link-hover: #dde0f0;

		--clr-danger:          #e07070;
		--clr-danger-bg:       #2a1212;
		--clr-danger-border:   #6a2020;
		--clr-warning:         #f0a040;
		--clr-warning-bg:      #221608;
		--clr-warning-border:  #604010;
		--clr-success:         #60c87a;
		--clr-success-bg:      #0e2018;
		--clr-success-border:  #20583a;

		--clr-badge-pending:   #f0a030;
		--clr-badge-pending-bg: #2a1e04;
		--clr-badge-detected:  #e07070;
		--clr-badge-detected-bg: #2a0808;
		--clr-badge-mod-author-bg: #1e4a9e;

		--clr-notification:    #e07070;

		--shadow-sm: 0 1px 3px rgba(0,0,0,0.35);
		--shadow-md: 0 2px 8px rgba(0,0,0,0.5);
	}
}

/* ── Reset & base ────────────────────────────────────────────────────────── */
:where(:not(ul):not(ol)), *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	font-size: 15px;
	line-height: 1.6;
	background: var(--clr-bg);
	color: var(--clr-text);
	min-height: 100vh;
}

a {
	color: var(--clr-link);
	text-decoration: none;
}
a:hover {
	color: var(--clr-link-hover);
	text-decoration: underline;
}

h1 { font-size: 1.6rem; font-weight: 700; margin-bottom: 1rem; }
h2 { font-size: 1.2rem; font-weight: 600; margin: 1.25rem 0 0.6rem; }
h3 { font-size: 1rem;   font-weight: 600; margin: 1rem 0 0.5rem; }

p { margin: 0.5rem 0; }

hr {
	border: none;
	border-top: 1px solid var(--clr-border);
	margin: 1rem 0;
}

code {
	font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
	font-size: 0.875em;
	background: var(--clr-surface-alt);
	border: 1px solid var(--clr-border);
	border-radius: var(--radius);
	padding: 0.1em 0.35em;
}

blockquote {
	border-left: 3px solid var(--clr-border);
	padding-left: 0.75rem;
	color: var(--clr-text-muted);
	margin: 0.5rem 0;
}

[hidden] {
	display: none !important;
}

/* ── Form elements ───────────────────────────────────────────────────────── */
input[type=text],
input[type=search],
input[type=file],
select,
textarea {
	font-family: inherit;
	font-size: inherit;
	color: var(--clr-text);
	background: var(--clr-surface);
	border: 1px solid var(--clr-border);
	border-radius: var(--radius);
	padding: 0.35rem 0.6rem;
	outline: none;
	transition: border-color 0.15s;
}
input[type=text]:focus,
input[type=search]:focus,
select:focus,
textarea:focus {
	border-color: var(--clr-link);
	box-shadow: 0 0 0 2px color-mix(in srgb, var(--clr-link) 20%, transparent);
}
input[type=file] { padding: 0.25rem; }

textarea {
	resize: vertical;
	width: 100%;
}

label {
	display: inline-flex;
	align-items: center;
	gap: 0.3rem;
	cursor: pointer;
}

button {
	font-family: inherit;
	font-size: inherit;
	cursor: pointer;
	background: var(--clr-surface-alt);
	color: var(--clr-text);
	border: 1px solid var(--clr-border);
	border-radius: var(--radius);
	padding: 0.35rem 0.8rem;
	transition: background 0.15s, border-color 0.15s;
}
button:hover {
	background: var(--clr-border);
}
button[type=submit]:not(.destructive-action):not(.positive-action):not(.tag-remove-btn):not(.moderation-toggle):not(.no-button-background) {
	background: var(--clr-link);
	color: #fff;
	border-color: var(--clr-link);
}
button[type=submit]:not(.destructive-action):not(.positive-action):not(.tag-remove-btn):not(.moderation-toggle):not(.no-button-background):hover {
	background: var(--clr-link-hover);
	border-color: var(--clr-link-hover);
}

button.destructive-action {
	color: var(--clr-danger);
	border-color: var(--clr-danger-border);
}
button.destructive-action:hover {
	background: var(--clr-danger-bg);
}

button.positive-action {
	color: var(--clr-success);
	border-color: var(--clr-success-border);
}
button.positive-action:hover {
	background: var(--clr-success-bg);
}

/* ── Site header ─────────────────────────────────────────────────────────── */
#site-header {
	position: sticky;
	top: 0;
	z-index: 100;
	height: var(--header-height);
	background: var(--clr-header-bg);
	color: var(--clr-header-text);
	display: flex;
	align-items: center;
	gap: 1.25rem;
	padding: 0 1.5rem;
	box-shadow: var(--shadow-md);
}

#site-header .site-logo {
	font-size: 1.1rem;
	font-weight: 700;
	color: #fff;
	letter-spacing: 0.02em;
	text-decoration: none;
	flex-shrink: 0;
	height: 100%;
	display: flex;
	align-items: center;
	gap: .5em;
}
#site-header .site-logo:hover { color: #fff; text-decoration: none; opacity: 0.85; }

.site-logo img {
	max-height: 80%;
}

#site-header .site-nav {
	display: flex;
	align-items: center;
	gap: 0.25rem;
	flex-wrap: wrap;
	flex: 1;
}

#site-header .site-nav a {
	color: var(--clr-header-link);
	font-size: 0.9rem;
	white-space: nowrap;
	padding: 0.25rem 0.55rem;
	border-radius: var(--radius);
	transition: background 0.12s, color 0.12s;
}
#site-header .site-nav a:hover {
	color: var(--clr-header-link-hover);
	background: rgba(255, 255, 255, 0.08);
	text-decoration: none;
}

#site-header .user-info {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	margin-left: auto;
	color: var(--clr-header-text);
	font-size: 0.9rem;
	white-space: nowrap;
}

.user-avatar {
	border-radius: 50%;
	vertical-align: middle;
	width: 28px;
	height: 28px;
}

#site-header form {
	display: inline;
}
#site-header button {
	background: transparent;
	border: 1px solid rgba(255,255,255,0.2);
	color: var(--clr-header-link);
	font-size: 0.85rem;
	padding: 0.2rem 0.6rem;
}
#site-header button:hover {
	background: rgba(255,255,255,0.1);
	color: var(--clr-header-link-hover);
	border-color: rgba(255,255,255,0.35);
}

.notification-count {
	display: inline-block;
	background: var(--clr-notification);
	color: #fff;
	font-size: 0.72rem;
	font-weight: 700;
	border-radius: 3px;
	padding: 0 0.3em;
	line-height: 1.4;
	vertical-align: middle;
	margin-left: 0.2em;
}

/* ── Page layout ─────────────────────────────────────────────────────────── */
main {
	max-width: var(--content-width);
	margin: 0 auto;
	padding: 1.5rem 1.25rem 3rem;
}

main > nav {
	margin-bottom: 1rem;
	font-size: 0.9rem;
	color: var(--clr-text-muted);
}
main > nav a {
	color: var(--clr-text-muted);
}
main > nav a:hover { color: var(--clr-link); }

/* Login page */
main.page-centered {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-height: calc(100vh - var(--header-height));
	padding-top: 0;
	gap: 1rem;
	text-align: center;
}

.login-prompt { color: var(--clr-text-muted); margin-bottom: 0.5rem; }

.login-btn {
	display: inline-block;
	background: #5865f2; /* Discord brand */
	color: #fff !important;
	font-weight: 600;
	padding: 0.65rem 1.5rem;
	border-radius: var(--radius-lg);
	text-decoration: none !important;
	font-size: 1rem;
	transition: opacity 0.15s;
}
.login-btn:hover { opacity: 0.88; }

.error {
	color: var(--clr-danger);
	background: var(--clr-danger-bg);
	border: 1px solid var(--clr-danger-border);
	border-radius: var(--radius);
	padding: 0.5rem 0.75rem;
}
.success-message {
	color: var(--clr-success);
	background: var(--clr-success-bg);
	border: 1px solid var(--clr-success-border);
	border-radius: var(--radius);
	padding: 0.5rem 0.75rem;
}

/* ── Status badges ───────────────────────────────────────────────────────── */
.status-badge {
	display: inline-block;
	font-size: 0.75em;
	font-weight: 600;
	padding: 0.1em 0.45em;
	border-radius: var(--radius);
	vertical-align: middle;
	line-height: 1.5;
}
.status-badge--vt-pending {
	background: var(--clr-badge-pending-bg);
	color: var(--clr-badge-pending);
	border: 1px solid var(--clr-badge-pending);
}
.status-badge--vt-detected {
	background: var(--clr-badge-detected-bg);
	color: var(--clr-badge-detected);
	border: 1px solid var(--clr-badge-detected);
}
.status-badge--vt-clean {
	background: var(--clr-success-bg);
	color: var(--clr-success);
	border: 1px solid var(--clr-success-border);
}

.mod-author-badge {
	display: inline-block;
	background: var(--clr-badge-mod-author-bg);
	color: #fff;
	font-size: 0.72em;
	font-weight: 700;
	padding: 0.1em 0.45em;
	border-radius: var(--radius);
	vertical-align: middle;
}

/* ── Mod search bar (index) ──────────────────────────────────────────────── */
.mod-search-bar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem;
	margin: 1rem 0;
}

.mod-search-form {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem;
	flex: 1;
	padding: 0.6rem 0.9rem;
	background: var(--clr-surface);
	border: 1px solid var(--clr-border);
	border-radius: var(--radius-lg);
	box-shadow: var(--shadow-sm);
}
.mod-search-form input[type=search] { flex: 1; min-width: 140px; }

.submit-mod-btn {
	display: inline-block;
	padding: 0.6rem 1rem;
	background: var(--clr-link);
	color: #fff;
	border-radius: var(--radius-lg);
	font-weight: 600;
	font-size: 0.9rem;
	white-space: nowrap;
	text-decoration: none;
	border: 1px solid var(--clr-link);
	transition: background 0.15s;
}
.submit-mod-btn:hover {
	background: var(--clr-link-hover);
	color: #fff;
	text-decoration: none;
}

.active-tag-filter {
	font-size: 0.9rem;
	color: var(--clr-text-muted);
	margin: 0 0 0.75rem;
}
.active-tag-filter strong { color: var(--clr-text); }
.tag-filter-joiner { margin: 0 0.25rem; font-style: italic; }

/* ── Tag overlay ─────────────────────────────────────────────────────────── */
.tag-overlay {
	border: 1px solid color-mix(in srgb, var(--clr-border) 60%, transparent);
	border-radius: 12px;
	padding: 0;
	width: min(480px, 92vw);
	max-height: min(560px, 85vh);
	flex-direction: column;
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18), 0 2px 8px rgba(0, 0, 0, 0.1);
	background: var(--clr-surface);
	color: var(--clr-text);
	/* <dialog> default positioning is already centered; reinforce it */
	margin: auto;
}
.tag-overlay[open] { display: flex; }
.tag-overlay::backdrop {
	background: rgba(0, 0, 0, 0.45);
	backdrop-filter: blur(2px);
}
.tag-overlay-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 1rem 1.25rem 0.85rem;
	border-bottom: 1px solid var(--clr-border);
	flex-shrink: 0;
}
.tag-overlay-title { font-weight: 600; font-size: 1rem; }
.tag-overlay-mode {
	display: flex;
	gap: 0.15rem;
	background: var(--clr-bg);
	border: 1px solid var(--clr-border);
	border-radius: var(--radius);
	padding: 0.2rem;
}
.tag-overlay-mode label {
	display: flex;
	align-items: center;
	gap: 0.3rem;
	padding: 0.2rem 0.55rem;
	border-radius: calc(var(--radius) - 1px);
	font-size: 0.8rem;
	cursor: pointer;
	color: var(--clr-text-muted);
	transition: background 0.1s, color 0.1s;
}
.tag-overlay-mode label:has(input:checked) {
	background: var(--clr-surface);
	color: var(--clr-text);
	box-shadow: var(--shadow-sm);
}
.tag-overlay-mode input[type=radio] { display: none; }
.tag-overlay-search {
	margin: 0.85rem 1.25rem 0.5rem;
	padding: 0.45rem 0.75rem;
	border: 1px solid var(--clr-border);
	border-radius: var(--radius);
	background: var(--clr-bg);
	color: var(--clr-text);
	font-size: 0.875rem;
	width: calc(100% - 2.5rem);
	box-sizing: border-box;
	flex-shrink: 0;
}
.tag-overlay-search:focus { outline: none; border-color: var(--clr-link); box-shadow: 0 0 0 2px color-mix(in srgb, var(--clr-link) 20%, transparent); }
.tag-overlay-list {
	overflow-y: auto;
	flex: 1;
	padding: 0.5rem 1.25rem 0.75rem;
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	align-content: flex-start;
}
.tag-overlay-item {
	display: contents;
}
.tag-overlay-item input[type=checkbox] { display: none; }
.tag-overlay-item input[type=checkbox]:checked + .tag {
	background: var(--clr-link);
	color: #fff;
	border-color: var(--clr-link);
}
.tag-overlay-footer {
	display: flex;
	justify-content: flex-end;
	align-items: center;
	gap: 0.6rem;
	padding: 0.85rem 1.25rem;
	border-top: 1px solid var(--clr-border);
	flex-shrink: 0;
	background: var(--clr-surface-alt);
	border-radius: 0 0 12px 12px;
}

/* ── Mod grid ────────────────────────────────────────────────────────────── */
.mod-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 1rem;
}

.mod-card {
	position: relative;
	display: flex;
	flex-direction: column;
	background: var(--clr-surface);
	border: 1px solid var(--clr-border);
	border-radius: var(--radius-lg);
	overflow: hidden;
	box-shadow: var(--shadow-sm);
	transition: box-shadow 0.15s, border-color 0.15s;
}
.mod-card:hover {
	box-shadow: var(--shadow-md);
	border-color: color-mix(in srgb, var(--clr-link) 40%, var(--clr-border));
}

.mod-card-image-link {
	display: block;
	line-height: 0;
}
.mod-card-thumbnail {
	width: 100%;
	aspect-ratio: 1;
	object-fit: cover;
	display: block;
}

/* Stretched-link: the mod name <a> covers the full card behind the content */
.mod-card-name a::after {
	content: '';
	position: absolute;
	inset: 0;
	z-index: 0;
}
/* Tags sit above the stretched link */
.mod-card .tag { position: relative; z-index: 1; }

.mod-card-overlay-badge {
	position: absolute;
	top: 0.4rem;
	left: 0.4rem;
	font-size: 0.7rem;
	font-weight: 700;
	padding: 0.15em 0.5em;
	border-radius: var(--radius);
	pointer-events: none;
}
.mod-card-overlay-badge--detected {
	background: var(--clr-badge-detected-bg);
	color: var(--clr-badge-detected);
	border: 1px solid var(--clr-badge-detected);
}
.mod-card-overlay-badge--pending {
	background: var(--clr-badge-pending-bg);
	color: var(--clr-badge-pending);
	border: 1px solid var(--clr-badge-pending);
}
.mod-card-overlay-badge--hidden {
	background: var(--clr-surface-alt);
	color: var(--clr-text-muted);
	border: 1px solid var(--clr-border);
}

.mod-card-stats {
	display: flex;
	gap: 0.75rem;
	align-items: center;
	padding: 0.45rem 0.75rem;
	background: var(--clr-surface-alt);
	border-bottom: 1px solid var(--clr-border);
	font-size: 0.82rem;
	color: var(--clr-text-muted);
}

.mod-card-stat {
	display: inline-flex;
	align-items: center;
	gap: 0.28rem;
}
.mod-card-stat--stars { color: #c9920a; }
.mod-card-stat--downloads { color: var(--clr-text-muted); }

@media (prefers-color-scheme: dark) {
	.mod-card-stat--stars { color: #e8b030; }
	.mod-stat--stars { color: #e8b030; }
	.star-btn .star-icon { color: var(--clr-text-muted); }
	.star-btn:hover .star-icon, .star-btn--starred .star-icon { color: #e8b030; }
}

.mod-card-body {
	display: flex;
	flex-direction: column;
	gap: 0.4rem;
	padding: 0.75rem;
}

.mod-card-heading {
	display: flex;
	flex-direction: column;
	gap: 0.1rem;
}

.mod-card-name {
	font-size: 0.95rem;
	font-weight: 600;
	margin: 0;
	line-height: 1.3;
}
.mod-card-name a {
	color: var(--clr-text);
	text-decoration: none;
	word-break: break-word;
}
.mod-card-name a:hover { color: var(--clr-link); }

.mod-card-author {
	font-size: 0.78rem;
	color: var(--clr-text-muted);
}

.mod-card-description {
	font-size: 0.82rem;
	color: var(--clr-text-muted);
	line-height: 1.45;
	margin: 0;
}

.tag-list { display: flex; flex-wrap: wrap; gap: 0.25rem; }

.tag {
	display: inline-block;
	font-size: 0.78rem;
	padding: 0.1em 0.5em;
	border-radius: 999px;
	background: var(--clr-surface-alt);
	color: var(--clr-text-muted);
	border: 1px solid var(--clr-border);
	text-decoration: none;
	transition: background 0.12s, color 0.12s;
}
.tag:hover {
	background: var(--clr-link);
	color: #fff;
	border-color: var(--clr-link);
	text-decoration: none;
}

/* ── Mod hero (mod page top section) ─────────────────────────────────────── */
.mod-hero {
	display: flex;
	gap: 1.25rem;
	align-items: flex-start;
	margin: 1rem 0 1.25rem;
	padding: 1.25rem;
	background: var(--clr-surface);
	border: 1px solid var(--clr-border);
	border-radius: var(--radius-lg);
	box-shadow: var(--shadow-sm);
}
.mod-hero .mod-icon {
	border-radius: var(--radius-lg);
	flex-shrink: 0;
	width: 112px;
	height: 112px;
	object-fit: cover;
}
.mod-hero .mod-meta-block { flex: 1; min-width: 0; position: relative; }
.mod-hero h1 { margin-bottom: 0.25rem; padding-right: 2rem; }

.mod-byline {
	color: var(--clr-text-muted);
	font-size: 0.9rem;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.4rem;
	margin: 0.25rem 0 0.75rem;
}
.mod-stat {
	display: inline-flex;
	align-items: baseline;
	gap: 0.2rem;
}
.mod-stat--stars { color: #c9920a; }
.star-btn {
	display: inline-flex;
	align-items: center;
	gap: 0.2rem;
	background: none;
	border: none;
	cursor: pointer;
	padding: 0;
	font-size: inherit;
	color: var(--clr-text-muted);
	line-height: 1;
}
.star-btn .star-icon { color: var(--clr-text-muted); transition: color 0.12s; }
.star-btn:hover .star-icon, .star-btn--starred .star-icon { color: #c9920a; }

/* ── Cogwheel action menu ─────────────────────────────────────────────────── */
.mod-cog-menu {
	position: absolute;
	top: 0;
	right: 0;
}
.mod-cog-menu > summary {
	list-style: none;
	cursor: pointer;
	width: 1.75rem;
	height: 1.75rem;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: var(--radius);
	color: var(--clr-text-muted);
	font-size: 1.1rem;
	user-select: none;
}
.mod-cog-menu > summary::-webkit-details-marker { display: none; }
.mod-cog-menu > summary:hover { background: var(--clr-bg); color: var(--clr-text); }
.mod-cog-panel {
	position: absolute;
	top: calc(100% + 2px);
	right: 0;
	min-width: 180px;
	background: var(--clr-surface);
	border: 1px solid var(--clr-border);
	border-radius: var(--radius);
	box-shadow: var(--shadow-md);
	padding: 0.3rem;
	z-index: 10;
	display: flex;
	flex-direction: column;
	gap: 0.1rem;
}
.mod-cog-panel a,
.mod-cog-panel > form > button,
.mod-cog-panel > button {
	display: block;
	width: 100%;
	box-sizing: border-box;
	text-align: left;
	padding: 0.35rem 0.65rem;
	border-radius: var(--radius);
	font-size: 0.875rem;
	background: none;
	border: none;
	cursor: pointer;
	color: var(--clr-text);
	text-decoration: none;
}
.mod-cog-panel a:hover,
.mod-cog-panel > form > button:hover,
.mod-cog-panel > button:hover { background: var(--clr-bg); text-decoration: none; }
.mod-cog-panel .destructive-action { color: var(--clr-danger, #c0392b); }
.mod-cog-panel .destructive-action:hover { background: var(--clr-bg); }
.mod-cog-panel .positive-action { color: var(--clr-success, #27ae60); }
.mod-cog-panel hr { border: none; border-top: 1px solid var(--clr-border); margin: 0.25rem 0; }
.mod-cog-panel .report-inline-form {
	display: flex;
	gap: 0.3rem;
	padding: 0.25rem 0.65rem 0.35rem;
}
.mod-cog-panel .report-inline-form input[type=text] { flex: 1; min-width: 0; font-size: 0.8rem; }
.mod-cog-panel .report-inline-form button { width: auto; padding: 0.2rem 0.5rem; }

.mod-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	align-items: center;
	margin-top: 0.5rem;
}

.mod-hidden-notice {
	background: var(--clr-warning-bg);
	border: 1px solid var(--clr-warning-border);
	color: var(--clr-warning);
	border-radius: var(--radius);
	padding: 0.65rem 0.9rem;
	margin: 0.75rem 0;
	font-size: 0.9rem;
}

/* ── Dependency list ─────────────────────────────────────────────────────── */
.dependency-list {
	margin: 0.75rem 0;
	padding: 0.75rem 1rem;
	background: var(--clr-surface);
	border: 1px solid var(--clr-border);
	border-radius: var(--radius);
}
.dependency-list strong { display: block; margin-bottom: 0.4rem; }
.dependency-list ul {
	list-style: none;
	display: flex;
	flex-direction: column;
	gap: 0.2rem;
	padding-left: 0.5rem;
}
.dependency-list li::before {
	content: "→ ";
	color: var(--clr-text-muted);
}

/* ── Image gallery ───────────────────────────────────────────────────────── */
.mod-image-gallery-section { margin: 0.75rem 0; }
.mod-image-gallery {
	display: flex;
	gap: 0.5rem;
	overflow-x: auto;
	overflow-y: hidden;
	padding: 0;
	scroll-snap-type: x mandatory;
	padding-bottom: 7px;
}
.gallery-item {
	position: relative;
	flex-shrink: 0;
	height: 150px;
	scroll-snap-align: start;
}
.gallery-item.dragging { opacity: 0.4; }
.gallery-thumb {
	max-height: 150px;
	max-width: 260px;
	object-fit: contain;
	cursor: pointer;
	border-radius: var(--radius-sm);
	display: block;
}
.gallery-delete-btn {
	position: absolute;
	top: 3px;
	right: 3px;
	background: rgba(0,0,0,.65);
	color: #fff;
	border: none;
	border-radius: 50%;
	width: 22px;
	height: 22px;
	font-size: 15px;
	line-height: 1;
	cursor: pointer;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 0;
}
.gallery-item:hover .gallery-delete-btn { display: flex; }
.gallery-upload-form { margin-top: 0.4rem; }
.gallery-upload-btn {
	display: inline-block;
	padding: 0.3rem 0.75rem;
	border: 1px dashed var(--clr-border);
	border-radius: var(--radius-sm);
	cursor: pointer;
	font-size: 0.85rem;
	color: var(--clr-text-muted);
}
.gallery-upload-btn:hover { border-color: var(--clr-link); color: var(--clr-link); }

/* Lightbox */
#lightbox {
	position: fixed;
	inset: 0;
	background: rgba(0,0,0,.88);
	z-index: 2000;
	display: none;
	align-items: center;
	justify-content: center;
}
#lightbox.open { display: flex; }
#lightbox img {
	max-width: calc(100vw - 20px);
	max-height: calc(100vh - 20px);
	object-fit: contain;
	border-radius: var(--radius-sm);
}
#lightbox-close {
	position: absolute;
	top: 10px;
	right: 16px;
	background: none;
	border: none;
	color: #fff;
	font-size: 2rem;
	line-height: 1;
	cursor: pointer;
}
#lightbox-prev, #lightbox-next {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	background: none;
	border: none;
	color: #fff;
	font-size: 4rem;
	line-height: 1;
	cursor: pointer;
	padding: 0 0.5rem;
	opacity: 0.7;
}
#lightbox-prev:hover, #lightbox-next:hover { opacity: 1; }
#lightbox-prev { left: 0; }
#lightbox-next { right: 0; }

/* ── Tag section (mod page) ──────────────────────────────────────────────── */
.tag-section {
	margin: 0.75rem 0;
	padding: 0.75rem 1rem;
	background: var(--clr-surface);
	border: 1px solid var(--clr-border);
	border-radius: var(--radius);
}
.tag-section > strong { display: block; margin-bottom: 0.5rem; }

.tag-with-remove {
	display: inline-flex;
	align-items: center;
	gap: 0;
}

.tag-remove-btn {
	background: none;
	border: none;
	color: var(--clr-text-muted);
	padding: 0 0.2em;
	font-size: 0.85em;
	cursor: pointer;
	line-height: 1;
	border-radius: 0 999px 999px 0;
}
.tag-remove-btn:hover { color: var(--clr-danger); background: none; }

.tag-add-form {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	margin-top: 0.5rem;
}
.tag-request-area {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	margin-top: 0.5rem;
	flex-wrap: wrap;
}
.tag-request-hint { font-size: 0.82rem; color: var(--clr-text-muted); }

.pending-tag-requests {
	margin-top: 0.75rem;
	font-size: 0.88rem;
}

/* ── Mod readme ──────────────────────────────────────────────────────────── */
.mod-readme-wrap { position: relative; }
.mod-readme-edit-btn {
	position: absolute;
	top: 0.6rem;
	right: 0.75rem;
	color: var(--clr-text-muted);
	display: flex;
	align-items: center;
	z-index: 1;
}
.mod-readme-edit-btn:hover { color: var(--clr-text); }
.mod-readme {
	margin: 1rem 0;
	padding: 1.25rem;
	background: var(--clr-surface);
	border: 1px solid var(--clr-border);
	border-radius: var(--radius-lg);
	overflow-x: auto;
}
.mod-readme h1:first-child {
	margin-top: 0;
}
.mod-readme h1, .mod-readme h2, .mod-readme h3,
.mod-readme h4, .mod-readme h5, .mod-readme h6 {
	margin: 1.2em 0 0.5em;
}
.mod-readme h1 { font-size: 1.4rem; border-bottom: 1px solid var(--clr-border); padding-bottom: 0.3em; }
.mod-readme h2 { font-size: 1.15rem; border-bottom: 1px solid var(--clr-border); padding-bottom: 0.2em; }
.mod-readme p  { margin: 0.7em 0; }
.mod-readme ul, .mod-readme ol { padding-left: 1.5rem; margin: 0.5em 0; }
.mod-readme pre {
	background: var(--clr-surface-alt);
	border: 1px solid var(--clr-border);
	border-radius: var(--radius);
	padding: 0.75rem 1rem;
	overflow-x: auto;
	margin: 0.75em 0;
}
.mod-readme pre code {
	background: none;
	border: none;
	padding: 0;
	font-size: 0.875rem;
}
.mod-readme img { max-width: 100%; height: auto; }
.mod-readme table {
	border-collapse: collapse;
	width: 100%;
	margin: 0.75em 0;
}
.mod-readme table th,
.mod-readme table td {
	border: 1px solid var(--clr-border);
	padding: 0.35rem 0.6rem;
}
.mod-readme blockquote {
	border-left: 3px solid var(--clr-border);
	padding-left: 0.75rem;
	margin-left: 0;
	color: var(--clr-text-muted);
}

/* ── Thread list (mod page) ──────────────────────────────────────────────── */
.thread-list {
	width: 100%;
	border-collapse: collapse;
	background: var(--clr-surface);
	border-radius: var(--radius-lg);
	overflow: hidden;
	box-shadow: var(--shadow-sm);
	margin: 0.5rem 0;
}
.thread-list th {
	text-align: left;
	padding: 0.5rem 0.75rem;
	font-size: 0.8rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--clr-text-muted);
	background: var(--clr-surface-alt);
	border-bottom: 1px solid var(--clr-border);
}
.thread-list td {
	padding: 0.55rem 0.75rem;
	border-bottom: 1px solid var(--clr-border);
	vertical-align: middle;
}
.thread-list tr:last-child td { border-bottom: none; }
.thread-list tr:hover td { background: var(--clr-surface-alt); }

.thread-new-form {
	padding: 1rem;
	background: var(--clr-surface);
	border: 1px solid var(--clr-border);
	border-radius: var(--radius-lg);
	margin-top: 0.75rem;
	display: flex;
	flex-direction: column;
	gap: 0.6rem;
}
.thread-new-form input[type=text] { width: 100%; }

/* ── Thread posts ────────────────────────────────────────────────────────── */
.thread-opening-post,
.thread-post {
	background: var(--clr-surface);
	border: 1px solid var(--clr-border);
	border-radius: var(--radius-lg);
	margin: 0.6rem 0;
	overflow: hidden;
}

.thread-opening-post .post-header {
	padding: 0.65rem 1rem;
	background: var(--clr-surface-alt);
	border-bottom: 1px solid var(--clr-border);
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.post-author { font-weight: 600; }
.post-timestamp { font-size: 0.82rem; color: var(--clr-text-muted); }
.post-edited-label { font-size: 0.82rem; color: var(--clr-text-muted); font-style: italic; }
.post-visibility-label { font-size: 0.82rem; color: var(--clr-text-muted); font-style: italic; }

.post-controls {
	margin-left: auto;
	display: flex;
	gap: 0.35rem;
	align-items: center;
	flex-wrap: wrap;
}
.post-controls button,
.post-controls input[type=text] {
	font-size: 0.82rem;
	padding: 0.2rem 0.5rem;
}

.thread-opening-post .post-body {
	padding: 0.9rem 1rem;
	white-space: pre-wrap;
	word-break: break-word;
}

/* Reply posts use <details> */
.thread-post > summary {
	list-style: none;
	cursor: pointer;
	padding: 0.65rem 1rem;
	background: var(--clr-surface-alt);
	border-bottom: 1px solid transparent;
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 0.5rem;
	user-select: none;
}
.thread-post > summary::-webkit-details-marker { display: none; }
.thread-post[open] > summary { border-bottom-color: var(--clr-border); }

.thread-post .post-body {
	padding: 0.9rem 1rem;
	white-space: pre-wrap;
	word-break: break-word;
}

.thread-post--hidden-by-author { border-color: var(--clr-border); }
.thread-post--hidden-by-author > summary { color: var(--clr-text-muted); }

.thread-post--moderator-deleted {
	border-color: var(--clr-danger-border);
	border-left: 3px solid var(--clr-danger);
}
.thread-post--moderator-deleted > summary { color: var(--clr-danger); }

.thread-post--self-deleted {
	background: var(--clr-surface);
	border: 1px solid var(--clr-border);
	border-radius: var(--radius);
	padding: 0.5rem 1rem;
	color: var(--clr-text-muted);
	font-size: 0.9rem;
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

/* ── Thread status badges ─────────────────────────────────────────────────── */
.thread-status-badge {
	display: inline-block;
	font-size: 0.7rem;
	font-weight: 600;
	padding: 0.15em 0.55em;
	border-radius: 999px;
	vertical-align: middle;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}
.thread-status-badge--done {
	background: var(--clr-success-bg);
	color: var(--clr-success);
	border: 1px solid var(--clr-success-border);
}
.thread-status-badge--wont-do {
	background: var(--clr-surface-alt);
	color: var(--clr-text-muted);
	border: 1px solid var(--clr-border);
}
.thread-opening-post--resolved { opacity: 0.75; }
.thread-list-cell--resolved a,
.thread-list-cell--resolved { color: var(--clr-text-muted); }

.post-edit-form {
	padding: 0 1rem 0.75rem;
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}
.post-edit-form .edit-form-actions { display: flex; gap: 0.4rem; }
.post-edit-form textarea { min-height: 100px; }

.thread-reply-form {
	padding: 1rem;
	background: var(--clr-surface);
	border: 1px solid var(--clr-border);
	border-radius: var(--radius-lg);
	margin-top: 1rem;
	display: flex;
	flex-direction: column;
	gap: 0.6rem;
}

/* ── Report cards ────────────────────────────────────────────────────────── */
.report-card {
	background: var(--clr-surface);
	border: 1px solid var(--clr-border);
	border-radius: var(--radius-lg);
	padding: 0.9rem 1rem;
	margin: 0.65rem 0;
	box-shadow: var(--shadow-sm);
}
.report-card--mod-report {
	border-color: var(--clr-warning-border);
	border-left: 3px solid var(--clr-warning);
}
.report-card--post-report .reported-content {
	background: var(--clr-surface-alt);
	border-left: 3px solid var(--clr-border);
	padding: 0.5rem 0.75rem;
	border-radius: 0 var(--radius) var(--radius) 0;
	font-size: 0.9rem;
	white-space: pre-wrap;
	word-break: break-word;
	color: var(--clr-text);
	margin: 0.5rem 0;
}
.report-subject { font-size: 0.95rem; margin-bottom: 0.25rem; }
.report-meta { font-size: 0.82rem; color: var(--clr-text-muted); margin-bottom: 0.4rem; }
.report-controls { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; margin-top: 0.5rem; }

/* ── User list (moderation) ──────────────────────────────────────────────── */
.user-search-form {
	display: flex;
	gap: 0.5rem;
	align-items: center;
	margin-bottom: 1rem;
}

.user-list {
	width: 100%;
	border-collapse: collapse;
	background: var(--clr-surface);
	border-radius: var(--radius-lg);
	overflow: hidden;
	box-shadow: var(--shadow-sm);
}
.user-list th {
	text-align: left;
	padding: 0.5rem 0.75rem;
	font-size: 0.8rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--clr-text-muted);
	background: var(--clr-surface-alt);
	border-bottom: 1px solid var(--clr-border);
}
.user-list td {
	padding: 0.55rem 0.75rem;
	border-bottom: 1px solid var(--clr-border);
	vertical-align: middle;
}
.user-list tr:last-child td { border-bottom: none; }
.user-list tr:hover td { background: var(--clr-surface-alt); }

.user-ban-form {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	align-items: center;
}
.user-ban-form label { font-size: 0.82rem; }
.user-ban-form button { font-size: 0.82rem; padding: 0.2rem 0.5rem; }

/* ── User posts (moderation) ─────────────────────────────────────────────── */
.user-profile-header {
	padding: 1rem;
	background: var(--clr-surface);
	border: 1px solid var(--clr-border);
	border-radius: var(--radius-lg);
	margin-bottom: 1rem;
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	align-items: flex-start;
}
.user-profile-info { flex: 1; min-width: 160px; }
.user-profile-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	align-items: center;
}
.user-profile-actions form { display: contents; }

.user-post-search { display: flex; gap: 0.5rem; align-items: center; margin: 0.75rem 0; }

.post-list-item {
	background: var(--clr-surface);
	border: 1px solid var(--clr-border);
	border-radius: var(--radius);
	padding: 0.75rem 1rem;
	margin: 0.5rem 0;
}
.post-list-item .post-context { font-size: 0.9rem; margin-bottom: 0.25rem; }
.post-list-item .post-meta { font-size: 0.82rem; color: var(--clr-text-muted); margin-bottom: 0.4rem; }

/* ── Tag requests (moderation) ───────────────────────────────────────────── */
.tag-admin-panel {
	background: var(--clr-surface);
	border: 1px solid var(--clr-border);
	border-radius: var(--radius-lg);
	padding: 1rem;
	margin-bottom: 1.5rem;
}
.tag-admin-panel .add-tag-form {
	display: flex;
	gap: 0.5rem;
	align-items: center;
	margin-bottom: 0.75rem;
}
.existing-tag-list {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	margin-top: 0.5rem;
}

.tag-request-queue { margin-top: 1rem; }
.tag-request-list {
	width: 100%;
	border-collapse: collapse;
	background: var(--clr-surface);
	border-radius: var(--radius-lg);
	overflow: hidden;
	box-shadow: var(--shadow-sm);
}
.tag-request-list th {
	text-align: left;
	padding: 0.5rem 0.75rem;
	font-size: 0.8rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--clr-text-muted);
	background: var(--clr-surface-alt);
	border-bottom: 1px solid var(--clr-border);
}
.tag-request-list td {
	padding: 0.55rem 0.75rem;
	border-bottom: 1px solid var(--clr-border);
	vertical-align: middle;
}
.tag-request-list tr:last-child td { border-bottom: none; }

.tag-request-actions { display: flex; gap: 0.4rem; align-items: center; }

/* ── Contact pages ───────────────────────────────────────────────────────── */
.contact-form { display: flex; flex-direction: column; gap: 0.75rem; max-width: 600px; }
.contact-form label { flex-direction: column; align-items: flex-start; gap: 0.25rem; width: 100%; }
.contact-form input[type=text],
.contact-form select { width: 100%; }

.mod-send-message { margin: 1rem 0; }
.mod-send-message > summary { cursor: pointer; font-weight: 600; margin-bottom: 0.5rem; }
.mod-send-message .contact-form { margin-top: 0.5rem; }

.contact-message {
	background: var(--clr-surface);
	border: 1px solid var(--clr-link);
	border-radius: var(--radius-lg);
	padding: 0.9rem 1rem;
	margin: 0.6rem 0;
	box-shadow: var(--shadow-sm);
}
.contact-message--handled {
	border-color: var(--clr-border);
	opacity: 0.7;
}
.contact-message-header { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem; cursor: pointer; list-style: none; }
.contact-message-header::-webkit-details-marker { display: none; }
.contact-message-subject { font-weight: 600; }
.contact-message-meta { font-size: 0.82rem; color: var(--clr-text-muted); }
.contact-message-body { white-space: pre-wrap; word-break: break-word; font-size: 0.92rem; margin: 0.5rem 0; }
.contact-handled-notice { font-size: 0.82rem; color: var(--clr-text-muted); }

.message-route-badge {
	display: inline-block;
	background: #6f42c1;
	color: #fff;
	font-size: 0.75em;
	font-weight: 600;
	padding: 0.1em 0.45em;
	border-radius: var(--radius);
}

/* ── Audit log ───────────────────────────────────────────────────────────── */
.audit-log {
	width: 100%;
	border-collapse: collapse;
	background: var(--clr-surface);
	border-radius: var(--radius-lg);
	overflow: hidden;
	box-shadow: var(--shadow-sm);
}
.audit-log th {
	text-align: left;
	padding: 0.5rem 0.75rem;
	font-size: 0.8rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--clr-text-muted);
	background: var(--clr-surface-alt);
	border-bottom: 1px solid var(--clr-border);
}
.audit-log td {
	padding: 0.5rem 0.75rem;
	border-bottom: 1px solid var(--clr-border);
	vertical-align: middle;
	font-size: 0.88rem;
}
.audit-log .audit-timestamp { white-space: nowrap; color: var(--clr-text-muted); }
.audit-log .audit-details { word-break: break-word; }
.audit-log tr:last-child td { border-bottom: none; }
.audit-log tr:hover td { background: var(--clr-surface-alt); }

.pagination-nav { display: flex; gap: 1rem; margin-top: 1rem; }

/* ── Versions page ───────────────────────────────────────────────────────── */
.version-entry { margin: 1rem 0; }
.version-heading {
	display: flex;
	align-items: baseline;
	gap: 0.6rem;
	flex-wrap: wrap;
}
.version-heading .version-date { font-size: 0.8rem; color: var(--clr-text-muted); font-weight: 400; }
.version-heading .version-download { font-size: 0.85rem; }
.version-heading .version-download-count { font-size: 0.8rem; color: var(--clr-text-muted); }
.version-deps { font-size: 0.88rem; color: var(--clr-text-muted); margin: 0.3rem 0; }
.version-deps a { color: var(--clr-link); }

/* ── Submit page ─────────────────────────────────────────────────────────── */
.upload-instructions {
	background: var(--clr-surface);
	border: 1px solid var(--clr-border);
	border-radius: var(--radius);
	padding: 0.75rem 1rem;
	margin-bottom: 1rem;
	font-size: 0.9rem;
	color: var(--clr-text-muted);
}
.upload-form { display: flex; flex-direction: column; gap: 1rem; }
.upload-dropzone {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 0.6rem;
	width: 100%;
	min-height: 200px;
	border: 2px dashed var(--clr-border);
	border-radius: var(--radius-lg);
	background: var(--clr-surface);
	color: var(--clr-text-muted);
	cursor: pointer;
	transition: border-color 0.15s, background 0.15s, color 0.15s;
	padding: 2rem;
	text-align: center;
}
.upload-dropzone:hover, .upload-dropzone.drag-over {
	border-color: var(--clr-link);
	background: color-mix(in srgb, var(--clr-link) 6%, var(--clr-surface));
	color: var(--clr-text);
}
.upload-dropzone-primary { font-size: 1.05rem; font-weight: 500; }
.upload-dropzone-hint { font-size: 0.82rem; }

/* ── Edit README ─────────────────────────────────────────────────────────── */
.readme-edit-form { display: flex; flex-direction: column; gap: 0.75rem; }
.readme-editor { font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace; font-size: 0.875rem; min-height: 500px; }
.readme-edit-actions { display: flex; gap: 0.5rem; align-items: center; }

/* ── Batch-dismiss panel ─────────────────────────────────────────────────── */
.batch-dismiss-panel {
	background: var(--clr-surface);
	border: 1px solid var(--clr-border);
	border-radius: var(--radius);
	padding: 0.75rem 1rem;
	margin-bottom: 1rem;
}
.batch-dismiss-form { display: flex; gap: 0.5rem; align-items: center; margin-top: 0.5rem; }
