/**
 * Blideo Blames — global site theme.
 *
 * A dark, purple, subtly-gradient skin applied across the whole site (header,
 * nav, content, footer, forms). It exposes site-level CSS variables that the
 * per-game tracker inherits by default, so every game is on-brand out of the
 * box while still being able to override its own accents/background.
 *
 * SINGLE SOURCE OF TRUTH: every colour, radius and font used anywhere on the
 * front end is a token in the :root block below. Components reference tokens
 * only — to re-skin the site, edit :root and nothing else. The game tracker's
 * `--cs-*` variables are mapped onto these tokens at the bottom of :root, and a
 * per-game accent/Custom CSS still overrides only that game's own tracker box.
 */

:root {
	/* ---- Background --------------------------------------------------------- */
	--site-bg: #0e0720;
	--site-bg-2: #160c2e;

	/* ---- Brand accent ------------------------------------------------------- */
	/* The RGB triplets let every translucent glow / shadow / tint derive from
	   the SAME purple via rgb(var(--site-accent-rgb) / a) — change the accent
	   once here and surfaces, borders, glows and selection all follow. */
	--site-accent: #8b5cf6;        /* violet */
	--site-accent-2: #c084fc;      /* lighter purple */
	--site-accent-rgb: 139, 92, 246;
	--site-accent-2-rgb: 192, 132, 252;
	--site-accent-gradient: linear-gradient(90deg, var(--site-accent), var(--site-accent-2));

	/* ---- Surfaces + borders ------------------------------------------------- */
	--site-surface: rgba(255, 255, 255, 0.04);                /* neutral white veil */
	--site-surface-2: rgba(var(--site-accent-rgb), 0.10);     /* accent-tinted panel */
	--site-border: rgba(var(--site-accent-rgb), 0.20);
	--site-popover-bg: #1a0f33;                               /* solid dropdown/menu bg */
	--site-header-bg: linear-gradient(180deg, rgba(31, 18, 61, 0.92), rgba(18, 10, 38, 0.72));

	/* ---- Text scale (body text → brightest near-white accents) -------------- */
	--site-text: #ece9f5;
	--site-text-dim: #b3a8d4;
	--site-text-dim-rgb: 179, 168, 212;
	--site-text-soft: #e9d5ff;     /* links on hover, inline code */
	--site-text-bright: #f3e8ff;   /* active / hover nav + menu items */
	--site-heading: #f6f3ff;       /* headings, strong labels */
	--site-on-accent: #fff;        /* text on an accent fill */

	/* ---- Semantic status (shared by site forms AND the game tracker) -------- */
	--site-ok: #86efac;
	--site-ok-strong: #bbf7d0;
	--site-ok-bg: rgba(34, 197, 94, 0.12);
	--site-ok-border: rgba(34, 197, 94, 0.4);
	--site-err: #fca5a5;
	--site-err-strong: #fecaca;
	--site-err-bg: rgba(239, 68, 68, 0.12);
	--site-err-border: rgba(239, 68, 68, 0.4);
	--site-logout: #f7a8c4;        /* log-out / destructive menu link */
	--site-warn-rgb: 246, 196, 83; /* amber — "missable" badges, warnings */

	/* ---- Radius scale ------------------------------------------------------- */
	--site-radius: 14px;           /* cards, panels, hero */
	--site-radius-md: 12px;        /* popovers, fieldsets */
	--site-radius-sm: 10px;        /* inputs, note boxes */
	--site-radius-xs: 8px;         /* chips, code, dropdown links */

	/* ---- Shadows ------------------------------------------------------------ */
	--site-shadow-card: 0 10px 30px rgba(0, 0, 0, 0.25);
	--site-shadow-pop: 0 18px 44px rgba(0, 0, 0, 0.55);
	--site-glow-accent: 0 8px 22px rgba(var(--site-accent-rgb), 0.4);

	--site-font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

	/* ---- Tracker mapping ---------------------------------------------------- */
	/* Map the tracker's component variables to the site palette globally, so
	   .cs-* components (cards, panels, leaderboard) render dark-themed on the
	   landing and profile pages too — not just inside .cs-tracker/.cs-archive.
	   The tracker re-declares these locally, and per-game styling still wins. */
	--cs-accent: var(--site-accent);
	--cs-accent-2: var(--site-accent-2);
	--cs-bg: transparent;
	--cs-surface: var(--site-surface);
	--cs-surface-2: var(--site-surface-2);
	--cs-border: var(--site-border);
	--cs-text: var(--site-text);
	--cs-text-dim: var(--site-text-dim);
	--cs-radius: var(--site-radius);
	--cs-ok: var(--site-ok);
	--cs-err: var(--site-err);
}

/* --- Base ---------------------------------------------------------------- */
html {
	scroll-behavior: smooth;
}

/* Keep the HTML `hidden` attribute authoritative — component display rules
   (e.g. display:flex) would otherwise out-specify the UA [hidden] default. */
[hidden] {
	display: none !important;
}

body {
	background-color: var(--site-bg);
	background-image:
		radial-gradient(1100px 600px at 12% -8%, rgba(var(--site-accent-rgb), 0.20), transparent 60%),
		radial-gradient(900px 520px at 100% 0%, rgba(var(--site-accent-2-rgb), 0.14), transparent 55%),
		linear-gradient(180deg, var(--site-bg-2) 0%, var(--site-bg) 100%);
	background-attachment: fixed;
	color: var(--site-text);
	font-family: var(--site-font);
	line-height: 1.65;
}

::selection {
	background: rgba(var(--site-accent-rgb), 0.45);
	color: var(--site-on-accent);
}

a {
	color: var(--site-accent-2);
	text-decoration: none;
	transition: color 0.15s ease;
}

a:hover,
a:focus {
	color: var(--site-text-soft);
}

h1, h2, h3, h4, h5, h6 {
	color: var(--site-heading);
	line-height: 1.2;
}

hr {
	border: 0;
	height: 1px;
	background: var(--site-border);
}

code, kbd, pre {
	background: var(--site-surface);
	border: 1px solid var(--site-border);
	border-radius: var(--site-radius-xs);
	color: var(--site-text-soft);
}

blockquote {
	border-left: 3px solid var(--site-accent);
	padding-left: 1rem;
	color: var(--site-text-dim);
}

img {
	border-radius: var(--site-radius-xs);
}

/* --- Layout -------------------------------------------------------------- */
.site {
	overflow-x: hidden;
}

.site-main {
	max-width: 1100px;
	margin: 0 auto;
	padding: 2.5rem 1.25rem 4rem;
}

/* The tracker/archive/landing manage their own width + padding. */
.site-main.cs-tracker,
.site-main.cs-archive {
	padding-top: 2rem;
}

/* --- Header -------------------------------------------------------------- */
.site-header {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 1.1rem clamp(1rem, 4vw, 2.5rem);
	background: var(--site-header-bg);
	border-bottom: 1px solid var(--site-border);
	box-shadow: 0 1px 0 rgba(var(--site-accent-rgb), 0.25), 0 10px 30px rgba(0, 0, 0, 0.35);
	-webkit-backdrop-filter: blur(10px);
	backdrop-filter: blur(10px);
	position: sticky;
	top: 0;
	z-index: 100;
}

.site-branding {
	display: flex;
	flex-direction: column;
	gap: 0.1rem;
}

.site-title {
	margin: 0;
	font-size: 1.6rem;
	font-weight: 800;
	letter-spacing: 0.01em;
}

.site-title a {
	display: inline-flex;
	align-items: center;
	gap: 0.55rem;
}

.site-title .site-title-text {
	background: var(--site-accent-gradient);
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
	color: transparent;
}

.site-logo-mark {
	flex: none;
	width: 40px;
	height: 40px;
	display: block;
	border-radius: var(--site-radius-sm);
	box-shadow: 0 4px 14px rgba(var(--site-accent-rgb), 0.35);
}

.site-description {
	margin: 0;
	color: var(--site-text-dim);
	font-size: 0.85rem;
}

.custom-logo {
	border-radius: var(--site-radius-sm);
}

/* --- Navigation ---------------------------------------------------------- */
/* Underscores ships .main-navigation { width:100% }, which forced the nav onto
   its own row and broke the header into a vertical stack. Let it size to its
   content so it sits inline in the header flex row. */
.main-navigation {
	width: auto;
}

.main-navigation ul {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.25rem;
	list-style: none;
	margin: 0;
	padding: 0;
}

.main-navigation li {
	position: relative;
}

.main-navigation a {
	display: block;
	padding: 0.5rem 0.9rem;
	border-radius: 999px;
	color: var(--site-text);
	font-weight: 600;
	font-size: 0.95rem;
	white-space: nowrap;
	transition: color 0.15s ease, background-color 0.15s ease;
}

.main-navigation a:hover,
.main-navigation a:focus-visible,
.main-navigation .current-menu-item > a,
.main-navigation .current_page_item > a,
.main-navigation .current-menu-parent > a,
.main-navigation .current-menu-ancestor > a {
	background: var(--site-surface-2);
	color: var(--site-text-bright);
}

.main-navigation .sub-menu {
	display: none;
	position: absolute;
	top: 100%;
	left: 0;
	min-width: 200px;
	flex-direction: column;
	background: var(--site-popover-bg);
	border: 1px solid var(--site-border);
	border-radius: var(--site-radius-md);
	padding: 0.4rem;
	box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
	z-index: 200;
}

.main-navigation li:hover > .sub-menu,
.main-navigation li:focus-within > .sub-menu {
	display: flex;
}

.menu-toggle {
	display: none;
	background: var(--site-surface-2);
	color: var(--site-text);
	border: 1px solid var(--site-border);
	border-radius: 999px;
	padding: 0.5rem 1rem;
	font-weight: 600;
	cursor: pointer;
}

/* --- Buttons ------------------------------------------------------------- */
/* ONE primary button shared by native <button>/submit/reset, WordPress block
   buttons, and the .cs-btn class (used on links styled as buttons). Variants:
   .cs-btn--ghost (secondary / outline) and .cs-btn--sm (compact). Specialised
   controls (.cs-filter, .cs-icon-btn, .cs-spoiler-toggle, .cs-usermenu__btn,
   .menu-toggle) intentionally override this with their own look. */
button,
input[type="button"],
input[type="submit"],
input[type="reset"],
.wp-block-button__link,
.wp-element-button,
.cs-btn {
	display: inline-block;
	background: var(--site-accent-gradient);
	color: var(--site-on-accent);
	border: 1px solid transparent;
	border-radius: 999px;
	padding: 0.6rem 1.2rem;
	font-weight: 700;
	line-height: 1.2;
	text-decoration: none;
	cursor: pointer;
	transition: transform 0.12s ease, box-shadow 0.12s ease;
}

button:hover,
input[type="button"]:hover,
input[type="submit"]:hover,
input[type="reset"]:hover,
.wp-block-button__link:hover,
.wp-element-button:hover,
.cs-btn:hover {
	transform: translateY(-1px);
	box-shadow: var(--site-glow-accent);
}

/* .cs-btn links commonly sit inline in a row (login CTA, run bar); keep a gap
   for containers that don't already use flex `gap`. */
.cs-btn {
	margin-right: 0.5rem;
}

/* Secondary / outline button. */
.cs-btn--ghost {
	background: transparent;
	color: var(--site-text);
	border-color: var(--site-border);
}

.cs-btn--ghost:hover {
	background: var(--site-surface-2);
	box-shadow: none;
}

/* Compact size (e.g. run-bar actions, "Save password"). */
.cs-btn--sm {
	padding: 0.4rem 0.9rem;
	font-size: 0.85rem;
}

/* Native file inputs (e.g. avatar upload): the browser renders the picker as
   its own "Choose file" button via the ::file-selector-button pseudo-element,
   which our button rules above can't reach. Style it to match — a compact
   ghost button. NOTE: the standard and -webkit- pseudo-elements must be in
   SEPARATE rules; a selector list containing an unknown pseudo-element is
   dropped wholesale by browsers that don't recognise it. */
input[type="file"] {
	color: var(--site-text-dim);
	font: inherit;
}

input[type="file"]::file-selector-button {
	appearance: none;
	-webkit-appearance: none;
	margin-right: 0.75rem;
	padding: 0.4rem 0.9rem;
	border-radius: 999px;
	border: 1px solid var(--site-border);
	background: var(--site-surface-2);
	color: var(--site-text);
	font-weight: 700;
	font-size: 0.85rem;
	cursor: pointer;
	transition: background 0.15s ease, border-color 0.15s ease;
}

input[type="file"]::file-selector-button:hover {
	background: var(--site-accent-gradient);
	border-color: transparent;
	color: var(--site-on-accent);
}

input[type="file"]::-webkit-file-upload-button {
	-webkit-appearance: none;
	margin-right: 0.75rem;
	padding: 0.4rem 0.9rem;
	border-radius: 999px;
	border: 1px solid var(--site-border);
	background: var(--site-surface-2);
	color: var(--site-text);
	font-weight: 700;
	font-size: 0.85rem;
	cursor: pointer;
	transition: background 0.15s ease, border-color 0.15s ease;
}

input[type="file"]::-webkit-file-upload-button:hover {
	background: var(--site-accent-gradient);
	border-color: transparent;
	color: var(--site-on-accent);
}

/* --- Form fields --------------------------------------------------------- */

input[type="text"],
input[type="email"],
input[type="url"],
input[type="password"],
input[type="search"],
input[type="number"],
textarea,
select {
	background: var(--site-surface);
	color: var(--site-text);
	border: 1px solid var(--site-border);
	border-radius: var(--site-radius-sm);
	padding: 0.55rem 0.8rem;
	font: inherit;
}

input:focus,
textarea:focus,
select:focus {
	outline: 2px solid var(--site-accent);
	outline-offset: 1px;
	border-color: transparent;
}

/* _s base (style.css) sets `input[type="..."]:focus { color: #111 }` at
   specificity (0,2,1), which beats the rules above and turns focused-field
   text near-black on the dark theme. Restore readable text globally; the
   type-listed selectors match that specificity and win by load order
   (site-theme.css is enqueued after style.css). */
input[type="text"]:focus,
input[type="email"]:focus,
input[type="url"]:focus,
input[type="password"]:focus,
input[type="search"]:focus,
input[type="number"]:focus,
input[type="tel"]:focus,
input[type="date"]:focus,
input[type="month"]:focus,
input[type="week"]:focus,
input[type="time"]:focus,
input[type="datetime"]:focus,
input[type="datetime-local"]:focus,
textarea:focus,
select:focus {
	color: var(--site-text);
}

::placeholder {
	color: rgba(var(--site-text-dim-rgb), 0.7);
}

/* --- Checkboxes ---------------------------------------------------------- */
/* ONE custom checkbox everywhere — account, comment forms, login "remember
   me", and the tracker's checklist items (.cs-item__check). The .cs-toggle
   switch opts out via :not(), since it's a different control. */
input[type="checkbox"]:not(.cs-toggle__input) {
	appearance: none;
	-webkit-appearance: none;
	flex: 0 0 auto;
	width: 20px;
	height: 20px;
	margin: 0;
	padding: 0;
	border-radius: 6px;
	border: 2px solid var(--site-border);
	background: var(--site-surface);
	cursor: pointer;
	position: relative;
	vertical-align: -0.2em;
	transition: border-color 0.15s ease, background 0.15s ease;
}

input[type="checkbox"]:not(.cs-toggle__input):checked {
	background: var(--site-accent);
	border-color: var(--site-accent);
}

input[type="checkbox"]:not(.cs-toggle__input):checked::after {
	content: "";
	position: absolute;
	left: 5px;
	top: 1px;
	width: 5px;
	height: 10px;
	border: solid var(--site-on-accent);
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
}

input[type="checkbox"]:not(.cs-toggle__input):disabled {
	cursor: not-allowed;
	opacity: 0.5;
}

input[type="checkbox"]:not(.cs-toggle__input):focus-visible {
	outline: 2px solid var(--site-accent-2);
	outline-offset: 2px;
}

/* --- Blog / page content cards ------------------------------------------- */
.site-main article,
.site-main .page,
.hentry {
	background: var(--site-surface);
	border: 1px solid var(--site-border);
	border-radius: var(--site-radius);
	padding: 1.75rem;
	margin-bottom: 2rem;
	box-shadow: var(--site-shadow-card);
}

/* Don't box the tracker/archive/landing — they have their own structure. */
.cs-tracker article,
.cs-archive article,
.site-main.cs-tracker,
.site-main.cs-archive {
	background: none;
	border: 0;
	box-shadow: none;
	padding-left: 0;
	padding-right: 0;
}

.entry-title a {
	color: var(--site-heading);
}

.entry-title a:hover {
	color: var(--site-accent-2);
}

.entry-meta,
.entry-footer,
.posted-on,
.byline {
	color: var(--site-text-dim);
	font-size: 0.85rem;
}

/* --- Page headers (search, 404, no-results) ----------------------------- */
/* Match the centered, gradient-title treatment used by the games archive
   (.cs-archive__head) and the landing hero, so every top-level page header
   reads the same across the site. */
.page-header {
	text-align: center;
	margin-bottom: 2rem;
}

.page-title {
	margin: 0 0 0.4rem;
	font-size: clamp(1.8rem, 4vw, 2.6rem);
	background: var(--site-accent-gradient);
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
	color: transparent;
}

/* --- Navigation between posts / pagination ------------------------------- */
.navigation .nav-links a,
.page-numbers {
	display: inline-block;
	padding: 0.4rem 0.85rem;
	border: 1px solid var(--site-border);
	border-radius: 999px;
	background: var(--site-surface);
}

.page-numbers.current {
	background: var(--site-accent-gradient);
	color: var(--site-on-accent);
	border-color: transparent;
}

/* --- Widgets / sidebar --------------------------------------------------- */
.widget {
	background: var(--site-surface);
	border: 1px solid var(--site-border);
	border-radius: var(--site-radius);
	padding: 1.25rem;
	margin-bottom: 1.5rem;
}

.widget-title {
	margin-top: 0;
	color: var(--site-heading);
}

/* --- Footer -------------------------------------------------------------- */
.site-footer {
	margin-top: 3rem;
	padding: 2rem 1.5rem;
	text-align: center;
	color: var(--site-text-dim);
	background: linear-gradient(180deg, transparent, rgba(var(--site-accent-rgb), 0.08));
	border-top: 1px solid var(--site-border);
}

.site-footer .site-info p {
	margin: 0;
	font-size: 0.9rem;
}

.site-footer .site-info a {
	color: var(--site-accent-2);
	text-decoration: none;
}

.site-footer .site-info a:hover {
	text-decoration: underline;
}

/* --- Header account menu ------------------------------------------------- */
/* Push the nav + account menu to the right, branding stays left. */
.site-branding {
	margin-right: auto;
}

.cs-usermenu {
	position: relative;
}

.cs-usermenu__btn {
	background: transparent;
	border: 2px solid var(--site-border);
	border-radius: 50%;
	padding: 0;
	width: 42px;
	height: 42px;
	cursor: pointer;
	overflow: hidden;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.cs-usermenu__btn:hover {
	border-color: var(--site-accent);
	box-shadow: 0 0 0 3px rgba(var(--site-accent-rgb), 0.25);
	transform: none;
}

.cs-usermenu__btn img {
	width: 100%;
	height: 100%;
	border-radius: 50%;
	display: block;
}

.cs-usermenu__login {
	display: inline-block;
	padding: 0.5rem 1.1rem;
	border-radius: 999px;
	border: 1px solid var(--site-border);
	color: var(--site-text);
	font-weight: 600;
}

.cs-usermenu__login:hover {
	background: var(--site-surface-2);
	color: var(--site-text-bright);
}

.cs-usermenu__panel {
	position: absolute;
	right: 0;
	top: calc(100% + 10px);
	min-width: 220px;
	background: var(--site-popover-bg);
	border: 1px solid var(--site-border);
	border-radius: var(--site-radius-md);
	padding: 0.4rem;
	box-shadow: var(--site-shadow-pop);
	z-index: 300;
	display: none;
	flex-direction: column;
}

.cs-usermenu.is-open .cs-usermenu__panel {
	display: flex;
}

.cs-usermenu__head {
	display: flex;
	flex-direction: column;
	padding: 0.6rem 0.7rem;
	border-bottom: 1px solid var(--site-border);
	margin-bottom: 0.3rem;
}

.cs-usermenu__head strong {
	color: var(--site-heading);
}

.cs-usermenu__email {
	color: var(--site-text-dim);
	font-size: 0.78rem;
	word-break: break-all;
}

.cs-usermenu__panel a {
	display: block;
	padding: 0.55rem 0.7rem;
	border-radius: var(--site-radius-xs);
	color: var(--site-text);
	font-weight: 600;
}

.cs-usermenu__panel a:hover {
	background: var(--site-surface-2);
	color: var(--site-text-bright);
}

.cs-usermenu__logout {
	color: var(--site-logout) !important;
}

/* --- Account / Edit Profile --------------------------------------------- */
.cs-account {
	max-width: 680px;
}

.cs-account__title {
	margin-bottom: 0.25rem;
}

.cs-account__sub {
	margin-top: 0;
}

.cs-field {
	margin-bottom: 1.25rem;
	border: 0;
	padding: 0;
	min-width: 0;
}

.cs-field__label {
	display: block;
	font-weight: 700;
	margin-bottom: 0.35rem;
	color: var(--site-heading);
}

.cs-field input[type="text"],
.cs-field input[type="email"],
.cs-field input[type="url"],
.cs-field input[type="password"],
.cs-field textarea {
	width: 100%;
}

.cs-field input:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

.cs-field--row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 1rem;
}

.cs-field--pass {
	background: var(--site-surface);
	border: 1px solid var(--site-border);
	border-radius: var(--site-radius-md);
	padding: 1rem 1.1rem;
}

.cs-hint {
	color: var(--site-text-dim);
	font-size: 0.82rem;
	margin: 0.35rem 0 0;
}

.cs-avatar-edit {
	display: flex;
	gap: 1rem;
	align-items: center;
}

.cs-avatar-edit__img {
	position: relative;
	display: inline-block;
	line-height: 0;
	flex: none;
}

.cs-avatar-edit img {
	border-radius: 50%;
	border: 2px solid var(--site-border);
}

/* (×) overlay to remove the current avatar — only rendered when one is set. */
.cs-avatar-remove {
	position: absolute;
	top: -4px;
	right: -4px;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 22px;
	height: 22px;
	padding: 0;
	font-size: 16px;
	line-height: 1;
	border-radius: 50%;
	background: var(--site-popover-bg);
	color: var(--site-text-dim);
	border: 1px solid var(--site-border);
	box-shadow: var(--site-shadow-card);
	cursor: pointer;
}

.cs-avatar-remove:hover,
.cs-avatar-remove:focus-visible {
	background: var(--site-err);
	color: var(--site-on-accent);
	border-color: transparent;
	transform: none;
	box-shadow: var(--site-shadow-card);
}

.cs-field--prefs {
	background: var(--site-surface);
	border: 1px solid var(--site-border);
	border-radius: var(--site-radius-md);
	padding: 1rem 1.1rem;
}

/* Toggle switch */
.cs-toggle {
	display: inline-flex;
	align-items: flex-start;
	gap: 0.65rem;
	margin: 0.4rem 0;
	cursor: pointer;
	font-size: 0.9rem;
	user-select: none;
}

.cs-toggle__text {
	display: flex;
	flex-direction: column;
	gap: 0.1rem;
}

.cs-toggle__title {
	font-weight: 600;
	color: var(--site-text);
}

.cs-toggle__label {
	color: var(--site-text-dim);
	font-size: 0.85rem;
	line-height: 1.3;
}

.cs-toggle__input {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
}

.cs-toggle__track {
	position: relative;
	flex: 0 0 auto;
	width: 44px;
	height: 24px;
	border-radius: 999px;
	background: var(--site-surface-2);
	border: 1px solid var(--site-border);
	transition: background 0.2s ease, border-color 0.2s ease;
}

.cs-toggle__thumb {
	position: absolute;
	top: 2px;
	left: 2px;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: var(--site-text-dim);
	transition: transform 0.2s ease, background 0.2s ease;
}

.cs-toggle__input:checked + .cs-toggle__track {
	background: var(--site-accent-gradient);
	border-color: transparent;
}

.cs-toggle__input:checked + .cs-toggle__track .cs-toggle__thumb {
	transform: translateX(20px);
	background: var(--site-on-accent);
}

.cs-toggle__input:focus-visible + .cs-toggle__track {
	outline: 2px solid var(--site-accent-2);
	outline-offset: 2px;
}

.cs-account__actions {
	margin-top: 1.5rem;
}

/* Inline-autosave: per-setting saved/error feedback. */
.cs-save-status {
	font-weight: 400;
	font-size: 0.8rem;
	margin-left: 0.5rem;
	opacity: 0;
	transition: opacity 0.15s ease;
}

.cs-save-status.is-saving,
.cs-save-status.is-ok,
.cs-save-status.is-err {
	opacity: 1;
}

.cs-save-status.is-saving {
	color: var(--site-text-dim);
}

.cs-save-status.is-ok {
	color: var(--site-ok);
}

.cs-save-status.is-ok::before {
	content: "✓ ";
}

.cs-save-status.is-err {
	color: var(--site-err);
}

/* The password save button — small, sits directly under its setting.
   (.cs-btn--sm itself is defined once, in the Buttons section above.) */
.cs-pass-actions {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	margin-top: 0.85rem;
}

/* With JS active, inline autosave replaces the page-level Save button. */
.cs-account.is-enhanced .cs-account__actions {
	display: none;
}

.cs-note-box {
	padding: 0.8rem 1rem;
	border-radius: var(--site-radius-sm);
	margin-bottom: 1.25rem;
	border: 1px solid;
}

.cs-note-box--ok {
	background: var(--site-ok-bg);
	border-color: var(--site-ok-border);
	color: var(--site-ok-strong);
}

.cs-note-box--err {
	background: var(--site-err-bg);
	border-color: var(--site-err-border);
	color: var(--site-err-strong);
}

/* --- Mobile nav ---------------------------------------------------------- */
@media (max-width: 768px) {
	.cs-field--row {
		grid-template-columns: 1fr;
	}

	.cs-usermenu {
		position: static;
	}

	.cs-usermenu__panel {
		right: 1rem;
	}
}

@media (max-width: 600px) {
	.site-header {
		gap: 0.5rem 0.75rem;
	}

	.site-title {
		font-size: 1.3rem;
	}

	/* Top row stays "logo … account"; the nav drops to its own row below. */
	.cs-usermenu {
		order: 2;
	}

	.main-navigation {
		order: 3;
		width: 100%;
	}

	.main-navigation ul {
		justify-content: flex-start;
	}

	.main-navigation a {
		padding: 0.45rem 0.7rem;
		font-size: 0.9rem;
	}
}
