/* Look copied from the Genus admin template (tokens: config/_variables.scss + base/_root.scss). */

@font-face {
	font-family: "IBM Plex Sans Variable";
	font-style: normal;
	font-weight: 100 700;
	font-display: swap;
	src: url("vendor/fonts/ibm-plex-sans-variable-latin.woff2") format("woff2");
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
	font-family: "IBM Plex Sans Variable";
	font-style: normal;
	font-weight: 100 700;
	font-display: swap;
	src: url("vendor/fonts/ibm-plex-sans-variable-latin-ext.woff2") format("woff2");
	unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
	font-family: "IBM Plex Mono";
	font-style: normal;
	font-weight: 500;
	font-display: swap;
	src: url("vendor/fonts/ibm-plex-mono-latin-500.woff2") format("woff2");
	unicode-range: U+0000-00FF, U+2000-206F;
}

@font-face {
	font-family: "IBM Plex Mono";
	font-style: normal;
	font-weight: 500;
	font-display: swap;
	src: url("vendor/fonts/ibm-plex-mono-latin-ext-500.woff2") format("woff2");
	unicode-range: U+0100-02BA, U+02BD-02FF, U+1E00-1EFF;
}

:root {
	color-scheme: light;
	--primary: #c2410c;
	--primary-hover: #a5370a;
	--primary-rgb: 194, 65, 12;
	--primary-subtle: #f3d9ce;
	--primary-emphasis: #4e1a05;
	--danger: #ef4444;
	--danger-hover: #dc2626;
	--danger-subtle: #fcd9d9;
	--danger-emphasis: #5f1b1b;
	--success: #22c55e;
	--success-subtle: #d3f3df;
	--success-emphasis: #0e4f26;
	--body-bg: #eceef1;
	--body-color: #1f2328;
	--heading-color: #14171a;
	--secondary-color: rgba(31, 35, 40, 0.68);
	--tertiary-bg: #f8f9fa;
	--border-color: #dde1e5;
	--card-bg: #ffffff;
	--input-bg: #eceef1;
	--hover-bg: color-mix(in srgb, #000 3%, var(--card-bg));
	--btn-light-bg: #ffffff;
	--btn-light-border: #cccccc;
	--btn-secondary-bg: #5a6169;
	--btn-secondary-hover: #4d535a;
	--topbar-bg: #f6f7f9;
	--topbar-color: #3a4047;
	--sidebar-bg: #16191d;
	--sidebar-color: #c9ced4;
	--sidebar-hover-bg: rgba(255, 255, 255, 0.05);
	--sidebar-active-bg: #2a2f35;
	--sidebar-accent: #f97316;
	--sidebar-section: #8a929b;
	--sidebar-border: #23282e;
	--shadow: 0 2px 8px rgba(17, 24, 39, 0.08);
	--shadow-lg: 0 8px 24px rgba(17, 24, 39, 0.12);
	--radius: 0.5rem;
	--radius-sm: 0.375rem;
	--radius-lg: 0.75rem;
	--sidebar-width: 260px;
	--topbar-height: 64px;
	--font: "IBM Plex Sans Variable", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--font-label: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

:root[data-theme="dark"] {
	color-scheme: dark;
	--primary-subtle: #270d02;
	--primary-emphasis: #da8d6d;
	--danger-subtle: #300e0e;
	--danger-emphasis: #f58f8f;
	--success-subtle: #07270f;
	--success-emphasis: #7adc9e;
	--body-bg: #1b1f27;
	--body-color: #dee2e6;
	--heading-color: #e9ecef;
	--secondary-color: rgba(222, 226, 230, 0.68);
	--tertiary-bg: #2a2f35;
	--border-color: #333a47;
	--card-bg: #272c39;
	--input-bg: #212529;
	--hover-bg: color-mix(in srgb, #fff 3%, var(--card-bg));
	--btn-light-bg: #2b3036;
	--btn-light-border: #555960;
	--topbar-bg: #16191d;
	--topbar-color: #adb5bd;
	--shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
	--shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.45);
}

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	-webkit-text-size-adjust: 100%;
}

body {
	margin: 0;
	font-family: var(--font);
	font-size: 0.9rem;
	line-height: 1.55;
	color: var(--body-color);
	background: var(--body-bg);
	-webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
.h4 {
	margin: 0 0 0.5rem;
	font-weight: 600;
	line-height: 1.25;
	color: var(--heading-color);
}

.h4 {
	font-size: 1.35rem;
}

p {
	margin: 0 0 1rem;
}

a {
	color: var(--primary);
}

[data-theme="dark"] a {
	color: var(--primary-emphasis);
}

[hidden] {
	display: none !important;
}

:focus-visible {
	outline: 2px solid var(--primary);
	outline-offset: 2px;
}

.text-secondary {
	color: var(--secondary-color);
}

.text-center {
	text-align: center;
}

.mb-4 {
	margin-bottom: 1.5rem;
}

.mono {
	font-family: var(--font-label);
	font-size: 0.85em;
}

/* ---------- buttons ---------- */

.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.4rem;
	padding: 0.5rem 1rem;
	font: inherit;
	font-weight: 500;
	line-height: 1.55;
	color: var(--body-color);
	text-decoration: none;
	white-space: nowrap;
	background: transparent;
	border: 1px solid transparent;
	border-radius: var(--radius);
	cursor: pointer;
	transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
	position: relative;
	overflow: hidden;
}

.btn i {
	font-size: 1.1em;
	line-height: 1;
}

.btn:disabled {
	opacity: 0.65;
	cursor: default;
}

.btn-primary {
	color: #fff;
	background: var(--primary);
	border-color: var(--primary);
}

.btn-primary:hover:not(:disabled) {
	background: var(--primary-hover);
	border-color: var(--primary-hover);
}

.btn-danger {
	color: #fff;
	background: var(--danger);
	border-color: var(--danger);
}

.btn-danger:hover:not(:disabled) {
	background: var(--danger-hover);
	border-color: var(--danger-hover);
}

.btn-secondary {
	color: #fff;
	background: var(--btn-secondary-bg);
	border-color: var(--btn-secondary-bg);
}

.btn-secondary:hover:not(:disabled) {
	background: var(--btn-secondary-hover);
}

.btn-light {
	color: var(--heading-color);
	background: var(--btn-light-bg);
	border-color: var(--btn-light-border);
}

.btn-light:hover:not(:disabled) {
	background: var(--tertiary-bg);
}

.btn-outline-danger {
	color: var(--danger);
	border-color: color-mix(in srgb, var(--danger) 45%, transparent);
}

.btn-outline-danger:hover:not(:disabled) {
	color: #fff;
	background: var(--danger);
}

.btn-sm {
	padding: 0.35rem 0.7rem;
	font-size: 0.82rem;
	border-radius: var(--radius-sm);
}

.btn-block {
	width: 100%;
}

/* the working paint: a light band sweeps across, the icon becomes a loader */
.btn.is-busy {
	pointer-events: none;
}

.btn.is-busy::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, 0.28) 50%, transparent 80%);
	animation: sweep 1.1s linear infinite;
}

@keyframes sweep {
	from {
		transform: translateX(-100%);
	}

	to {
		transform: translateX(100%);
	}
}

.icon-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.25rem;
	height: 2.25rem;
	padding: 0;
	font-size: 1.2rem;
	color: inherit;
	text-decoration: none;
	background: transparent;
	border: 0;
	border-radius: var(--radius);
	cursor: pointer;
}

.icon-btn:hover {
	background: color-mix(in srgb, currentColor 10%, transparent);
}

.link-btn {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	padding: 0.35rem 0.75rem;
	font: inherit;
	color: var(--secondary-color);
	background: transparent;
	border: 0;
	border-radius: var(--radius);
	cursor: pointer;
}

.link-btn:hover {
	color: var(--body-color);
}

.link {
	color: var(--primary);
	font-weight: 500;
}

[data-theme="dark"] .link {
	color: var(--primary-emphasis);
}

.theme-light-icon,
[data-theme="dark"] .theme-dark-icon {
	display: none;
}

[data-theme="dark"] .theme-light-icon {
	display: inline;
}

/* ---------- forms ---------- */

.form-group {
	margin-bottom: 1.1rem;
}

.form-label {
	display: block;
	margin-bottom: 0.4rem;
	font-weight: 500;
	color: var(--heading-color);
}

.form-control {
	display: block;
	width: 100%;
	padding: 0.5rem 0.9rem;
	font: inherit;
	color: var(--body-color);
	background: var(--input-bg);
	border: 1px solid var(--border-color);
	border-radius: var(--radius);
	transition: border-color 0.15s ease;
}

.form-control:focus {
	outline: 0;
	border-color: #da8d6d;
}

.form-control.is-invalid {
	border-color: var(--danger);
}

.form-text {
	margin-top: 0.3rem;
	font-size: 0.8rem;
	color: var(--secondary-color);
}

.invalid-feedback {
	display: none;
	margin-top: 0.3rem;
	font-size: 0.8rem;
	color: var(--danger);
}

.is-invalid ~ .invalid-feedback,
.input-password:has(.is-invalid) ~ .invalid-feedback {
	display: block;
}

.input-password {
	position: relative;
}

.input-password .form-control {
	padding-right: 2.75rem;
}

.input-password-toggle {
	position: absolute;
	top: 50%;
	right: 0.4rem;
	transform: translateY(-50%);
	display: inline-flex;
	padding: 0.35rem;
	font-size: 1.1rem;
	color: var(--secondary-color);
	background: transparent;
	border: 0;
	border-radius: var(--radius-sm);
	cursor: pointer;
}

.form-error {
	margin-bottom: 1rem;
	padding: 0.65rem 0.9rem;
	color: var(--danger-emphasis);
	background: var(--danger-subtle);
	border: 1px solid color-mix(in srgb, var(--danger) 30%, transparent);
	border-radius: var(--radius);
}

.form-check {
	display: flex;
	align-items: flex-start;
	gap: 0.6rem;
	cursor: pointer;
}

.form-check input {
	width: 1.2rem;
	height: 1.2rem;
	margin: 0.15rem 0 0;
	accent-color: var(--primary);
	flex-shrink: 0;
}

/* ---------- cards ---------- */

.card {
	background: var(--card-bg);
	border: 1px solid var(--border-color);
	border-radius: var(--radius-lg);
}

.card-body {
	padding: 1.25rem;
}

.card-header {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	padding: 1rem 1.25rem;
	border-bottom: 1px solid var(--border-color);
}

.card-title {
	font-weight: 600;
	color: var(--heading-color);
}

.card-form {
	max-width: 32rem;
}

/* ---------- badges ---------- */

.badge {
	display: inline-flex;
	align-items: center;
	gap: 0.25rem;
	padding: 0.2em 0.55em;
	font-size: 0.75rem;
	font-weight: 500;
	line-height: 1.4;
	color: var(--body-color);
	background: var(--tertiary-bg);
	border: 1px solid var(--border-color);
	border-radius: var(--radius-sm);
	white-space: nowrap;
}

.badge-success {
	color: var(--success-emphasis);
	background: var(--success-subtle);
	border-color: transparent;
}

.badge-danger {
	color: var(--danger-emphasis);
	background: var(--danger-subtle);
	border-color: transparent;
}

.badge-primary {
	color: var(--primary-emphasis);
	background: var(--primary-subtle);
	border-color: transparent;
}

/* ---------- auth layout ---------- */

.auth-page {
	min-height: 100vh;
	min-height: 100svh;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 2rem 1rem;
	background: radial-gradient(50rem 26rem at 80% -8%, rgba(var(--primary-rgb), 0.07), transparent 60%), radial-gradient(40rem 22rem at 0% 110%, rgba(var(--primary-rgb), 0.05), transparent 55%), var(--tertiary-bg);
}

[data-theme="dark"] .auth-page {
	background: radial-gradient(50rem 26rem at 80% -8%, rgba(var(--primary-rgb), 0.1), transparent 60%), var(--body-bg);
}

.auth-brand {
	display: flex;
	align-items: center;
	gap: 0.625rem;
	margin-bottom: 1.5rem;
}

.auth-brand-logo,
.sidebar-brand-logo {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.5rem;
	height: 2.5rem;
	color: #fff;
	font-size: 1.375rem;
	background: var(--primary);
	border-radius: var(--radius);
}

.auth-brand-text {
	font-size: 1.375rem;
	font-weight: 700;
	color: var(--heading-color);
}

.auth-card {
	width: 100%;
	max-width: 26.5rem;
	box-shadow: var(--shadow);
}

.auth-card > .card-body {
	padding: 2rem 1.5rem;
}

.auth-card h1 {
	text-align: center;
}

.auth-card h1 + .text-secondary {
	text-align: center;
}

.auth-folder {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.4rem;
	margin: 0 auto 1rem;
	width: fit-content;
	max-width: 100%;
	padding: 0.3rem 0.75rem;
	font-family: var(--font-label);
	font-size: 0.8rem;
	color: var(--primary-emphasis);
	background: var(--primary-subtle);
	border-radius: 50rem;
}

.auth-folder span {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.auth-footer {
	margin-top: 1.5rem;
}

@media (min-width: 576px) {
	.auth-card > .card-body {
		padding: 2.5rem;
	}
}

/* ---------- app layout: sidebar + topbar ---------- */

.app-sidebar {
	position: fixed;
	top: 0;
	bottom: 0;
	left: 0;
	z-index: 1040;
	display: flex;
	flex-direction: column;
	width: var(--sidebar-width);
	background: var(--sidebar-bg);
	border-right: 1px solid var(--sidebar-border);
	transition: transform 0.2s ease;
}

.sidebar-brand {
	display: flex;
	align-items: center;
	height: var(--topbar-height);
	padding: 0 1.25rem;
	border-bottom: 1px solid var(--sidebar-border);
	flex-shrink: 0;
}

.sidebar-brand-link,
.topbar-brand {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	color: #fff;
	font-size: 1.15rem;
	font-weight: 700;
	text-decoration: none;
}

.topbar-brand {
	color: var(--heading-color);
}

.sidebar-brand-logo {
	width: 30px;
	height: 30px;
	font-size: 1.1rem;
}

.sidebar-nav {
	margin: 0;
	padding: 0.75rem 0.75rem 1.5rem;
	list-style: none;
	overflow-y: auto;
}

.sidebar-section {
	padding: 1rem 0.75rem 0.35rem;
	font-family: var(--font-label);
	font-size: 0.7rem;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--sidebar-section);
}

.sidebar-link {
	position: relative;
	display: flex;
	align-items: center;
	gap: 0.75rem;
	margin-bottom: 0.15rem;
	padding: 0.6rem 0.75rem;
	font-size: 0.875rem;
	font-weight: 500;
	color: var(--sidebar-color);
	text-decoration: none;
	border-radius: var(--radius);
	transition: background 0.15s ease, color 0.15s ease;
}

.sidebar-link i {
	width: 1.25rem;
	font-size: 1.15rem;
	text-align: center;
}

.sidebar-link:hover {
	color: #fff;
	background: var(--sidebar-hover-bg);
}

.sidebar-link.active {
	color: #fff;
	background: var(--sidebar-active-bg);
	box-shadow: inset 3px 0 0 var(--sidebar-accent);
}

.sidebar-backdrop {
	display: none;
}

.app-main {
	min-height: 100vh;
	margin-left: var(--sidebar-width);
	display: flex;
	flex-direction: column;
}

.app-main-full {
	margin-left: 0;
}

.app-topbar {
	position: sticky;
	top: 0;
	z-index: 1030;
	display: flex;
	align-items: center;
	gap: 0.75rem;
	height: var(--topbar-height);
	padding: 0 1.5rem;
	color: var(--topbar-color);
	background: var(--topbar-bg);
	border-bottom: 1px solid var(--border-color);
}

[data-theme="dark"] .app-topbar {
	border-bottom-color: rgba(255, 255, 255, 0.08);
}

.topbar-spacer {
	flex: 1;
}

.app-topbar form {
	margin: 0;
}

.sidebar-toggle {
	display: none;
}

.app-content {
	flex: 1;
	width: 100%;
	padding: 1.5rem;
}

.app-content-narrow {
	max-width: 76rem;
	margin: 0 auto;
}

.page-header {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 1rem;
	margin-bottom: 1.25rem;
}

.page-title {
	margin: 0;
	font-size: 1.35rem;
	overflow-wrap: anywhere;
}

.page-subtitle {
	margin: 0.2rem 0 0;
	color: var(--secondary-color);
}

.section-header {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 1rem;
	margin: 2rem 0 1rem;
}

.section-title {
	margin: 0;
	font-size: 1.05rem;
}

@media (max-width: 991.98px) {
	.app-sidebar {
		transform: translateX(-100%);
	}

	.sidebar-open .app-sidebar {
		transform: none;
	}

	.sidebar-open .sidebar-backdrop {
		position: fixed;
		inset: 0;
		z-index: 1035;
		display: block;
		background: rgba(0, 0, 0, 0.45);
	}

	.app-main {
		margin-left: 0;
	}

	.sidebar-toggle {
		display: inline-flex;
	}
}

@media (max-width: 575.98px) {
	.app-content {
		padding: 1rem;
	}

	.app-topbar {
		padding: 0 1rem;
	}

	.app-topbar .btn span {
		display: none;
	}

	.page-header {
		flex-direction: column;
		align-items: stretch;
	}
}

/* ---------- lister (admin list) ---------- */

.lister-head,
.lister-row {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 7rem 7.5rem auto;
	align-items: center;
	gap: 1rem;
	padding: 1rem 1.25rem;
}

.lister-head {
	padding-top: 0.75rem;
	padding-bottom: 0.75rem;
	font-family: var(--font-label);
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--secondary-color);
	border-bottom: 1px solid var(--border-color);
}

.lister-row + .lister-row {
	border-top: 1px solid var(--border-color);
}

.lister-row:hover {
	background: var(--hover-bg);
}

.item-main {
	display: flex;
	align-items: center;
	gap: 0.85rem;
	min-width: 0;
}

.item-avatar {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.5rem;
	height: 2.5rem;
	font-size: 1.2rem;
	color: var(--primary-emphasis);
	background: var(--primary-subtle);
	border-radius: 50%;
	flex-shrink: 0;
}

.item-text {
	min-width: 0;
}

.item-name {
	font-weight: 600;
	color: var(--heading-color);
	overflow-wrap: anywhere;
}

.item-link {
	display: flex;
	align-items: center;
	gap: 0.25rem;
	font-size: 0.82rem;
	color: var(--secondary-color);
}

.item-link span {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.item-link button {
	padding: 0.1rem 0.25rem;
	font-size: 0.95rem;
	color: inherit;
	background: transparent;
	border: 0;
	border-radius: var(--radius-sm);
	cursor: pointer;
}

.item-link button:hover {
	color: var(--primary);
}

.item-date {
	font-size: 0.85rem;
	color: var(--secondary-color);
}

.item-actions {
	display: flex;
	gap: 0.4rem;
	justify-content: flex-end;
}

@media (max-width: 767.98px) {
	.lister-head {
		display: none;
	}

	.lister-row {
		grid-template-columns: minmax(0, 1fr) auto;
		grid-template-areas: "main main" "meta actions";
		row-gap: 0.75rem;
	}

	.lister-row .item-main {
		grid-area: main;
	}

	.lister-row .item-meta {
		grid-area: meta;
	}

	.lister-row .item-date {
		display: none;
	}

	.lister-row .item-actions {
		grid-area: actions;
	}

	.item-actions .btn span {
		display: none;
	}
}

.lister-loading {
	display: flex;
	justify-content: center;
	padding: 3rem 1rem;
}

.spinner {
	width: 1.75rem;
	height: 1.75rem;
	border: 2.5px solid var(--border-color);
	border-top-color: var(--primary);
	border-radius: 50%;
	animation: spin 0.8s linear infinite;
}

@keyframes spin {
	to {
		transform: rotate(360deg);
	}
}

/* empty / error states: centered, a muted icon, one heading, one line */
.state {
	padding: 3rem 1rem;
	text-align: center;
}

.state i.state-icon,
.empty-icon i {
	display: block;
	margin-bottom: 0.75rem;
	font-size: 3rem;
	line-height: 1;
	color: var(--secondary-color);
}

.state-title {
	margin-bottom: 0.35rem;
	font-weight: 600;
	color: var(--heading-color);
}

.state p {
	margin-bottom: 1.25rem;
	color: var(--secondary-color);
}

.state p:last-child {
	margin-bottom: 0;
}

/* ---------- modal (native dialog) ---------- */

.modal {
	width: min(32rem, calc(100% - 2rem));
	max-height: calc(100% - 2rem);
	padding: 0;
	color: var(--body-color);
	background: var(--card-bg);
	border: 0;
	border-radius: var(--radius-lg);
	box-shadow: var(--shadow-lg);
}

.modal::backdrop {
	background: rgba(0, 0, 0, 0.5);
}

.modal-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 0.85rem 1rem;
	border-bottom: 1px solid var(--border-color);
}

.modal-title {
	margin: 0;
	font-size: 1rem;
	font-weight: 600;
	color: var(--heading-color);
}

.modal-body {
	padding: 1rem;
}

.modal-body > :last-child {
	margin-bottom: 0;
}

.modal-footer {
	display: flex;
	justify-content: space-between;
	gap: 0.5rem;
	padding: 1rem;
	border-top: 1px solid var(--border-color);
}

.modal-footer:has(> :only-child) {
	justify-content: flex-end;
}

.credentials {
	display: grid;
	gap: 0.75rem;
	margin-bottom: 1rem;
}

.credential {
	padding: 0.65rem 0.85rem;
	background: var(--input-bg);
	border: 1px solid var(--border-color);
	border-radius: var(--radius);
}

.credential-label {
	font-family: var(--font-label);
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--secondary-color);
}

.credential-value {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem;
	font-family: var(--font-label);
	color: var(--heading-color);
	overflow-wrap: anywhere;
}

.credential-value .icon-btn {
	flex-shrink: 0;
	width: 2rem;
	height: 2rem;
	font-size: 1.05rem;
}

.notice {
	display: flex;
	gap: 0.5rem;
	padding: 0.65rem 0.85rem;
	font-size: 0.85rem;
	color: var(--primary-emphasis);
	background: var(--primary-subtle);
	border-radius: var(--radius);
}

/* ---------- toasts (top-right) ---------- */

.toasts {
	position: fixed;
	top: 1rem;
	right: 1rem;
	z-index: 1090;
	display: flex;
	flex-direction: column;
	gap: 0.6rem;
	width: min(24rem, calc(100% - 2rem));
	pointer-events: none;
}

.toast {
	display: flex;
	align-items: flex-start;
	gap: 0.6rem;
	padding: 0.8rem 0.9rem 0.8rem 1rem;
	color: var(--body-color);
	background: var(--card-bg);
	border: 1px solid var(--border-color);
	border-left: 3px solid var(--success);
	border-radius: var(--radius);
	box-shadow: var(--shadow-lg);
	pointer-events: auto;
	animation: toast-in 0.2s ease;
}

.toast > i {
	font-size: 1.15rem;
	line-height: 1.35;
	color: var(--success);
}

.toast-error {
	border-left-color: var(--danger);
}

.toast-error > i {
	color: var(--danger);
}

.toast-text {
	flex: 1;
}

.toast-close {
	padding: 0;
	font-size: 1rem;
	color: var(--secondary-color);
	background: transparent;
	border: 0;
	cursor: pointer;
}

@keyframes toast-in {
	from {
		opacity: 0;
		transform: translateY(-0.5rem);
	}
}

/* ---------- dropzone + upload queue ---------- */

.dropzone {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.25rem;
	padding: 2.5rem 1rem;
	text-align: center;
	background: var(--card-bg);
	border: 2px dashed var(--border-color);
	border-radius: var(--radius-lg);
	cursor: pointer;
	transition: border-color 0.15s ease, background 0.15s ease;
}

.dropzone:hover,
.dropzone.is-over {
	border-color: var(--primary);
	background: color-mix(in srgb, var(--primary) 4%, var(--card-bg));
}

.dropzone:focus-within {
	outline: 2px solid var(--primary);
	outline-offset: 2px;
}

.dropzone-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 3.5rem;
	height: 3.5rem;
	margin-bottom: 0.5rem;
	font-size: 1.75rem;
	color: var(--primary-emphasis);
	background: var(--primary-subtle);
	border-radius: 50%;
}

.dropzone-title {
	font-size: 1.05rem;
	font-weight: 600;
	color: var(--heading-color);
}

.dropzone-text {
	color: var(--secondary-color);
}

.upload-queue {
	margin-top: 1rem;
}

.upload-queue .card-header .badge {
	margin-left: auto;
}

.queue-list {
	margin: 0;
	padding: 0;
	list-style: none;
	max-height: 20rem;
	overflow-y: auto;
}

.queue-item {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr) auto;
	align-items: center;
	gap: 0.75rem;
	padding: 0.7rem 1.25rem;
}

.queue-item + .queue-item {
	border-top: 1px solid var(--border-color);
}

.queue-item > i {
	font-size: 1.25rem;
	color: var(--secondary-color);
}

.queue-item.is-done > i {
	color: var(--success);
}

.queue-item.is-error > i {
	color: var(--danger);
}

.queue-name {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	font-weight: 500;
}

.queue-status {
	font-size: 0.8rem;
	color: var(--secondary-color);
}

.queue-item.is-error .queue-status {
	color: var(--danger);
}

.progress {
	height: 4px;
	margin-top: 0.35rem;
	overflow: hidden;
	background: var(--border-color);
	border-radius: 50rem;
}

.progress-bar {
	width: 0;
	height: 100%;
	background: var(--primary);
	border-radius: inherit;
	transition: width 0.2s ease;
}

.queue-item.is-done .progress {
	display: none;
}

/* ---------- gallery (plate grid) ---------- */

.gallery {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
	gap: 1rem;
}

.gallery > .lister-loading,
.gallery > .state {
	grid-column: 1 / -1;
}

.gallery > .state {
	background: var(--card-bg);
	border: 1px solid var(--border-color);
	border-radius: var(--radius-lg);
}

.gallery-item {
	margin: 0;
	min-width: 0;
}

.gallery-plate {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	aspect-ratio: 4 / 3;
	padding: 0;
	overflow: hidden;
	color: var(--secondary-color);
	background: var(--card-bg);
	border: 1px solid var(--border-color);
	border-radius: var(--radius-lg);
	cursor: pointer;
	text-decoration: none;
}

.gallery-plate:hover {
	border-color: color-mix(in srgb, var(--primary) 50%, var(--border-color));
}

.gallery-plate img,
.gallery-plate video {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	background: var(--tertiary-bg);
}

.gallery-plate .file-icon {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.35rem;
	font-size: 2.5rem;
}

.gallery-plate .file-ext {
	font-family: var(--font-label);
	font-size: 0.75rem;
	text-transform: uppercase;
}

.gallery-badge {
	position: absolute;
	left: 0.5rem;
	bottom: 0.5rem;
	display: inline-flex;
	align-items: center;
	gap: 0.2rem;
	padding: 0.15rem 0.45rem;
	font-size: 0.72rem;
	font-weight: 600;
	color: #fff;
	background: rgba(0, 0, 0, 0.55);
	border-radius: var(--radius-sm);
	pointer-events: none;
}

.gallery-item figcaption {
	margin-top: 0.4rem;
	font-size: 0.82rem;
	line-height: 1.35;
}

.gallery-name {
	display: block;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	color: var(--heading-color);
}

.gallery-meta {
	color: var(--secondary-color);
	font-size: 0.75rem;
}

.gallery-item.is-new .gallery-plate {
	animation: plate-in 0.35s ease;
}

@keyframes plate-in {
	from {
		opacity: 0;
		transform: scale(0.96);
	}
}

/* ---------- lightbox ---------- */

.lightbox {
	width: 100%;
	max-width: 100%;
	height: 100%;
	max-height: 100%;
	margin: 0;
	padding: 0;
	color: #fff;
	background: rgba(10, 12, 15, 0.94);
	border: 0;
}

.lightbox[open] {
	display: grid;
	grid-template-columns: auto 1fr auto;
	grid-template-rows: auto 1fr;
}

.lightbox::backdrop {
	background: transparent;
}

.lightbox-bar {
	grid-column: 1 / -1;
	display: flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.75rem 1rem;
}

.lightbox-title {
	flex: 1;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	font-weight: 500;
}

.lightbox-stage {
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: 0;
	min-height: 0;
	padding: 0 0 1.5rem;
}

.lightbox-stage img,
.lightbox-stage video {
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
	border-radius: var(--radius-sm);
}

.lightbox-nav {
	align-self: center;
	margin: 0 0.5rem;
	width: 3rem;
	height: 3rem;
	font-size: 2rem;
	color: #fff;
	background: rgba(255, 255, 255, 0.08);
	border: 0;
	border-radius: 50%;
	cursor: pointer;
}

.lightbox-nav:hover {
	background: rgba(255, 255, 255, 0.18);
}

.lightbox-nav:disabled {
	visibility: hidden;
}

@media (max-width: 575.98px) {
	.lightbox-nav {
		width: 2.25rem;
		height: 2.25rem;
		margin: 0 0.25rem;
		font-size: 1.5rem;
	}

	.gallery {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 0.75rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
	}
}

/* ---------- topbar heading (page icon + title + subtitle) ---------- */

.topbar-heading {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	min-width: 0;
}

.topbar-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.4rem;
	height: 2.4rem;
	font-size: 1.2rem;
	color: var(--primary);
	background: var(--card-bg);
	border: 1px solid var(--border-color);
	border-radius: var(--radius);
	flex-shrink: 0;
}

[data-theme="dark"] .topbar-icon {
	color: var(--primary-emphasis);
	background: transparent;
}

.topbar-titles {
	min-width: 0;
	line-height: 1.3;
}

.topbar-title {
	font-size: 1rem;
	font-weight: 600;
	color: var(--heading-color);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.topbar-subtitle {
	font-size: 0.8rem;
	color: var(--secondary-color);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.toolbar {
	display: flex;
	justify-content: flex-end;
	gap: 0.5rem;
	margin-bottom: 1rem;
}

.dropzone-hint {
	margin-top: 0.35rem;
	font-size: 0.8rem;
	color: var(--secondary-color);
}

.visually-hidden {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: -1px !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	white-space: nowrap !important;
	border: 0 !important;
}

@media (max-width: 575.98px) {
	.topbar-subtitle {
		display: none;
	}
}
