/* Aurora — shared design system. "Galaxy / Aurora": deep night-sky surface, a living
   green→cyan→purple aurora gradient as the accent (matches the swirl logo and the in-client
   ClickGUI Theme.AURORA). Solid accent reads cyan; the gradient appears on hero, rails and rings.
   Legacy --violet* names are aliased to the aurora accent so every component recolors at once. */
:root {
	/* night-sky surfaces (from client Theme.AURORA panel stack) */
	--bg:        #080b14;
	--bg-2:      #0a0e18;
	--panel:     #121a2a;
	--panel-2:   #1a2336;
	--line:      #252d44;
	--line-2:    #313a55;
	--text:      #eef3fb;
	--muted:     #9fb2c8;
	--faint:     #7c8ca6; /* AA-checked on --panel */

	/* aurora accent: green → cyan → purple */
	--aurora-1:  #3ddc97;  /* lime-green */
	--aurora-2:  #19d3e0;  /* cyan */
	--aurora-3:  #9b5de5;  /* purple */
	--aurora-grad: linear-gradient(118deg, #3ddc97 0%, #19d3e0 48%, #9b5de5 100%);
	--aurora-glow: rgba(25,211,224,.20);

	/* legacy accent aliases → aurora (keeps all existing rules working) */
	--violet:    #19d3e0;
	--violet-2:  #74e0d6;
	--violet-dim: rgba(25,211,224,.14);
	--cyan:      #6fe3e8;   /* functional only: code / IDs / data */
	--green:     #3ddc97;
	--amber:     #ffc452;
	--red:       #ff5d79;

	--radius:    12px;
	--radius-sm: 8px;
	--radius-lg: 18px;
	--maxw:      1100px;

	/* soft elevation (no glow) */
	--shadow-1:  0 1px 2px rgba(0,0,0,.3);
	--shadow-2:  0 10px 30px rgba(0,0,0,.32);
	--shadow-3:  0 24px 60px rgba(0,0,0,.45);
	--ring:      0 0 0 3px rgba(25,211,224,.30);

	/* spacing scale (generous, editorial rhythm) */
	--s-1: .4rem; --s-2: .7rem; --s-3: 1.1rem; --s-4: 1.6rem; --s-5: 2.4rem; --s-6: 3.6rem; --s-7: 5.5rem;

	--ease: cubic-bezier(.2,.8,.2,1);

	--z-sticky: 50;
	--z-progress: 900;
	--z-toast: 1000;
	--font: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	--display: "Archivo Expanded", "Archivo", system-ui, sans-serif;
	--mono: ui-monospace, "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
	font-family: var(--font);
	background:
		radial-gradient(900px 480px at 100% -12%, rgba(155,93,229,.12), transparent 60%),
		radial-gradient(760px 420px at 0% -8%, rgba(61,220,151,.08), transparent 58%),
		var(--bg);
	color: var(--text);
	line-height: 1.6;
	font-size: 15px;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
	min-height: 100vh;
}
/* faint instrument grid (echoes the brand landing) */
body::before {
	content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
	background-image:
		linear-gradient(rgba(255,255,255,.016) 1px, transparent 1px),
		linear-gradient(90deg, rgba(255,255,255,.016) 1px, transparent 1px);
	background-size: 64px 64px;
	mask-image: radial-gradient(circle at 70% 0%, #000 35%, transparent 80%);
}
.admin-layout, .wrap, .nav { position: relative; z-index: 1; }
::selection { background: rgba(25,211,224,.32); color: #001318; }

a { color: var(--violet-2); text-decoration: none; transition: color .14s var(--ease); }
a:hover { color: #fff; }
a:focus-visible { outline: 2px solid var(--violet); outline-offset: 2px; border-radius: 3px; }
code { font-family: var(--mono); font-size: .85em; color: var(--cyan); }

/* Spoiler: secrets (license key / key hash) render blurred until clicked. JS toggles .on. */
.spoiler { filter: blur(.35em); cursor: pointer; user-select: none; transition: filter .12s ease; border-radius: 3px; }
.spoiler:hover { filter: blur(.2em); }
.spoiler.on { filter: none; user-select: text; }

h1, h2, h3 { line-height: 1.15; margin: 0 0 .6rem; letter-spacing: -.02em; font-weight: 700; }
.card .n, td, .hero-stats b, .plan .price, .stat-n { font-variant-numeric: tabular-nums; }

/* ---- skip link ---- */
.skip-link {
	position: absolute; left: .8rem; top: -3rem; z-index: 60;
	background: var(--violet); color: #03161a; font-weight: 700;
	padding: .55rem 1rem; border-radius: var(--radius-sm); transition: top .15s var(--ease);
}
.skip-link:focus { top: .8rem; color: #fff; outline: none; box-shadow: var(--ring); }

.truncate { max-width: 22ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- top navigation (public) ---- */
.nav {
	position: sticky; top: 0; z-index: var(--z-sticky);
	display: flex; align-items: center; gap: 1.6rem;
	padding: 1rem 2rem;
	background: rgba(10,11,15,.8);
	backdrop-filter: blur(14px);
	border-bottom: 1px solid var(--line);
}
.nav .brand {
	display: flex; align-items: center; gap: .6rem;
	font-family: var(--display); font-weight: 800; letter-spacing: .04em; font-size: 1rem; text-transform: uppercase; color: #fff;
}
.nav .brand .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--violet); }
.logo { display: block; }
.nav .links { display: flex; gap: 1.4rem; align-items: center; }
.nav .links a { color: var(--muted); font-size: .92rem; font-weight: 500; }
.nav .links a:hover, .nav .links a.active { color: #fff; }
.nav .spacer { margin-left: auto; }

.actions { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; }
.actions form { display: inline; }
.rollout-slider { display: inline-flex; align-items: center; gap: .6rem; }
/* Reset the global input chrome the range inherits (border/bg/padding/40px box) so the track sits
   centred on the same line as the number box instead of skewed inside a padded field. */
.rollout-slider input[type=range] {
	-webkit-appearance: none; appearance: none;
	width: 8rem; height: 40px; margin: 0; padding: 0; border: none; background: transparent;
	box-shadow: none; cursor: pointer;
}
.rollout-slider input[type=range]:hover { border: none; }
.rollout-slider input[type=range]:focus { outline: none; box-shadow: none; }
.rollout-slider input[type=range]::-webkit-slider-runnable-track {
	height: 6px; border-radius: 999px; background: var(--line-2);
}
.rollout-slider input[type=range]::-moz-range-track {
	height: 6px; border-radius: 999px; background: var(--line-2);
}
/* margin-top = -(thumb - track)/2 = -(16-6)/2 = -5px → thumb vertically centred on the track */
.rollout-slider input[type=range]::-webkit-slider-thumb {
	-webkit-appearance: none; appearance: none; margin-top: -5px;
	width: 16px; height: 16px; border-radius: 50%; background: var(--violet); border: none;
}
.rollout-slider input[type=range]::-moz-range-thumb {
	width: 16px; height: 16px; border-radius: 50%; background: var(--violet); border: none;
}
.rollout-slider input[type=number] { width: 4.2rem; text-align: right; }
.rollout-slider .unit { opacity: .6; }

/* ---- labelled field ---- */
.field { display: flex; flex-direction: column; gap: .3rem; }
.field > label { font-size: .76rem; color: var(--muted); font-weight: 600; letter-spacing: .01em; }
.field .hint { font-size: .74rem; color: var(--faint); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--s-3); }

/* ---- tri-state permission control ---- */
.tristate { display: inline-flex; border: 1px solid var(--line-2); border-radius: 99px; overflow: hidden; }
.tristate label { cursor: pointer; padding: .25rem .6rem; font-size: .8rem; color: var(--faint); line-height: 1; transition: background .12s; }
.tristate input { display: none; }
.tristate label:hover { background: var(--panel-2); }
.tristate input:checked + .ts-deny    { background: rgba(255,93,121,.16); color: var(--red); }
.tristate input:checked + .ts-inherit { background: var(--panel-2);        color: var(--muted); }
.tristate input:checked + .ts-grant   { background: rgba(74,208,138,.16);  color: var(--green); }

/* ---- admin sidebar ---- */
.admin-layout { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.sidebar {
	display: flex; flex-direction: column; gap: .4rem;
	background: var(--bg-2); border-right: 1px solid var(--line);
	padding: 1.8rem 1.1rem; position: sticky; top: 0; height: 100vh;
}
.sidebar .brand {
	display: flex; align-items: center; gap: .6rem;
	font-family: var(--display); font-weight: 800; letter-spacing: .04em; text-transform: uppercase; font-size: 1rem; color: #fff;
	padding: 0 .4rem; margin-bottom: 2rem;
}
.sidebar .brand .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--violet); }
.side-label { color: var(--faint); font-size: .66rem; text-transform: uppercase; letter-spacing: .14em; font-weight: 700; margin: 1rem .4rem .4rem; }
.side-links { display: flex; flex-direction: column; gap: .1rem; }
.side-links a {
	position: relative; color: var(--muted); font-size: .92rem; font-weight: 500;
	padding: .6rem .85rem; border-radius: var(--radius-sm);
	transition: background .14s var(--ease), color .14s var(--ease);
}
.side-links a:hover { background: var(--panel-2); color: var(--text); }
.side-links a.active { background: var(--violet-dim); color: #fff; font-weight: 600; }
.side-links a.active::before {
	content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
	width: 3px; height: 1.05rem; border-radius: 0 3px 3px 0; background: var(--violet);
}
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: .5rem; padding-top: 1.2rem; border-top: 1px solid var(--line); }
.side-foot a { color: var(--muted); font-size: .85rem; padding: .2rem .4rem; }
.side-foot a:hover { color: #fff; }
.admin-main { padding: var(--s-6) var(--s-6) var(--s-7); max-width: 1080px; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: var(--s-6) 2rem var(--s-7); }

/* ---- page header ---- */
.page-title { font-family: var(--display); font-size: clamp(1.7rem, 3vw, 2.3rem); font-weight: 800; text-transform: uppercase; letter-spacing: -.02em; }
.page-sub {
	color: var(--muted); font-size: 1rem; margin-top: .1rem; margin-bottom: var(--s-5);
	padding-bottom: var(--s-4); border-bottom: 1px solid var(--line); max-width: 70ch;
}

/* ---- tabs ---- */
.tabs { display: inline-flex; gap: .25rem; border-bottom: 1px solid var(--line); }
.tabs .tab {
	position: relative; color: var(--muted); font-size: .92rem; font-weight: 600;
	padding: .55rem .9rem; border-radius: var(--radius-sm) var(--radius-sm) 0 0;
	transition: color .15s var(--ease), background .15s var(--ease);
}
.tabs .tab:hover { color: var(--text); background: var(--panel-2); }
.tabs .tab.active { color: var(--text); }
.tabs .tab.active::after {
	content: ""; position: absolute; left: .6rem; right: .6rem; bottom: -1px;
	height: 2px; border-radius: 2px 2px 0 0; background: var(--violet);
}

/* ---- buttons ---- */
.btn {
	display: inline-flex; align-items: center; gap: .5rem;
	padding: .55rem 1.1rem; border: 1px solid var(--line-2); border-radius: var(--radius-sm);
	background: var(--panel-2); color: var(--text); font-size: .9rem; font-weight: 600;
	cursor: pointer; transition: background .14s var(--ease), border-color .14s var(--ease), color .14s var(--ease);
	font-family: var(--font);
}
.btn:hover { border-color: var(--line-2); background: #1f222d; color: #fff; }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn:active { transform: translateY(.5px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.btn:disabled:hover { background: var(--panel-2); border-color: var(--line-2); color: var(--text); }
.btn.primary { background: var(--violet); border-color: transparent; color: #03161a; font-weight: 700; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.cyan { background: var(--panel-2); border-color: var(--line-2); color: var(--text); }
.btn.cyan:hover { border-color: var(--violet); color: #fff; }
.btn.danger { background: transparent; border-color: rgba(255,93,121,.4); color: #ff9bb0; }
.btn.danger:hover { background: rgba(255,93,121,.12); border-color: var(--red); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--panel-2); }
.btn.sm { padding: .36rem .7rem; font-size: .82rem; }

/* ---- cards / panels ---- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: var(--s-3); }
.card {
	background: var(--panel);
	border: 1px solid var(--line); border-radius: var(--radius);
	padding: 1.5rem 1.5rem;
	transition: border-color .16s var(--ease);
}
.card:hover { border-color: var(--line-2); }
.card .label { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
.card .n { font-family: var(--display); font-size: 2.6rem; font-weight: 800; margin-top: .3rem; color: #fff; line-height: 1; letter-spacing: -.02em; }

.panel {
	background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
	padding: 1.5rem 1.6rem; margin-top: var(--s-4);
	box-shadow: var(--shadow-1);
}
.panel h2, .panel h3 {
	font-family: var(--display); font-size: .98rem; font-weight: 700; text-transform: uppercase; letter-spacing: .02em;
	padding-bottom: .8rem; margin-bottom: 1.1rem; border-bottom: 1px solid var(--line);
	display: flex; align-items: center; gap: .5rem;
}

/* ---- tables ---- */
table { width: 100%; border-collapse: collapse; }
th, td { padding: .75rem .9rem; text-align: left; font-size: .88rem; border-bottom: 1px solid var(--line); }
th { color: var(--faint); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; font-size: .68rem; }
tbody tr { transition: background .1s var(--ease); }
tbody tr:hover { background: rgba(25,211,224,.06); }
tbody tr:last-child td { border-bottom: 0; }
td code { color: var(--cyan); }

/* ---- form controls ---- */
input, select, textarea {
	padding: .55rem .8rem; border-radius: var(--radius-sm);
	border: 1px solid var(--line-2); background: var(--bg-2); color: var(--text);
	font-family: var(--font); font-size: .9rem; height: 40px; transition: border-color .12s, box-shadow .12s;
}
textarea { height: auto; }
input:hover, select:hover { border-color: var(--faint); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--violet); box-shadow: var(--ring); }
select {
	-webkit-appearance: none; appearance: none; padding-right: 2rem; cursor: pointer;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239a9fb1' stroke-width='3'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
	background-repeat: no-repeat; background-position: right .7rem center;
}
input[type="checkbox"] { height: auto; width: auto; accent-color: var(--violet); }
::placeholder { color: var(--faint); opacity: 1; }
input[type="color"] { height: 40px; padding: .15rem; cursor: pointer; }
.row { display: flex; gap: .7rem; align-items: center; flex-wrap: wrap; }
form.inline { display: inline; }
form[method="get"].row, .filter-bar {
	background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-sm);
	padding: .65rem .8rem;
}

/* ---- badges ---- */
.tag { display: inline-block; padding: .16rem .6rem; border-radius: 99px; font-size: .72rem; font-weight: 600; letter-spacing: .02em; }
.tag.ok   { background: rgba(74,208,138,.14); color: var(--green); }
.tag.bad  { background: rgba(255,93,121,.14); color: var(--red); }
.tag.off  { background: rgba(154,159,177,.14); color: var(--muted); }
.tag.info { background: var(--violet-dim); color: var(--violet-2); }

.banner {
	background: rgba(74,208,138,.08); border: 1px solid rgba(74,208,138,.28);
	padding: .9rem 1.1rem; border-radius: var(--radius-sm); margin-bottom: 1.3rem;
}
.banner code { color: var(--green); font-size: 1rem; }

dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: .55rem 1.6rem; }
dl.kv dt { color: var(--muted); }

footer {
	border-top: 1px solid var(--line); color: var(--faint);
	padding: var(--s-5) 2rem; text-align: center; font-size: .85rem;
}

/* ---- landing ---- */
.hero { text-align: center; padding: var(--s-7) 1.4rem var(--s-6); max-width: 860px; margin: 0 auto; }
.hero .eyebrow {
	display: inline-block; padding: .35rem .9rem; border-radius: 99px;
	border: 1px solid var(--line-2); color: var(--muted); font-size: .76rem;
	letter-spacing: .12em; text-transform: uppercase; margin-bottom: 1.8rem;
}
.hero h1 {
	font-size: clamp(2.8rem, 7vw, 5rem); font-weight: 800; letter-spacing: -.04em;
	color: #fff; text-wrap: balance; line-height: 1.02;
}
.hero p.lead { color: var(--muted); font-size: 1.2rem; max-width: 620px; margin: 1.4rem auto 2.2rem; line-height: 1.6; }
.hero .cta { display: flex; gap: .9rem; justify-content: center; flex-wrap: wrap; }

.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px,1fr)); gap: 1.4rem; max-width: var(--maxw); margin: var(--s-6) auto; padding: 0 2rem; }
.feature { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.8rem; transition: border-color .16s var(--ease); }
.feature:hover { border-color: var(--line-2); }
.feature .ic { font-size: 1.6rem; }
.feature h3 { margin-top: .6rem; font-size: 1.15rem; }
.feature p { color: var(--muted); font-size: .94rem; margin: 0; line-height: 1.6; }

.pricing { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px,1fr)); gap: 1.4rem; max-width: 920px; margin: var(--s-6) auto; padding: 0 2rem; }
.plan { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 2.2rem; text-align: center; }
.plan.featured { border-color: var(--violet); }
.plan .price { font-size: 2.6rem; font-weight: 800; margin: .5rem 0; letter-spacing: -.02em; }
.plan ul { list-style: none; padding: 0; margin: 1.4rem 0; color: var(--muted); font-size: .92rem; }
.plan li { padding: .45rem 0; border-bottom: 1px solid var(--line); }

/* ---- loaders & versions ---- */
.loaders { display: flex; gap: 1.4rem; justify-content: center; flex-wrap: wrap; margin: var(--s-4) 0; }
.loader-card {
	display: flex; flex-direction: column; align-items: center; gap: .6rem;
	background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
	padding: 1.5rem 2.2rem; min-width: 150px;
}
.loader-card img { border-radius: 10px; }
.loader-card b { font-size: 1rem; }
.versions { display: flex; gap: .7rem; justify-content: center; flex-wrap: wrap; margin-top: 1.2rem; }
.ver {
	padding: .45rem 1rem; border-radius: 99px; font-size: .85rem; font-weight: 600;
	background: var(--violet-dim); color: var(--violet-2); border: 1px solid transparent;
}
.ver.soon { background: var(--bg-2); color: var(--faint); border: 1px dashed var(--line-2); }

.discord-btn {
	display: inline-flex; align-items: center; gap: .6rem;
	background: #5865f2; color: #fff; border: 0; border-radius: var(--radius-sm);
	padding: .75rem 1.4rem; font-size: .95rem; font-weight: 700; cursor: pointer;
	transition: filter .14s var(--ease);
}
.discord-btn:hover { filter: brightness(1.1); color: #fff; }
.discord-btn.sm { padding: .45rem .85rem; font-size: .82rem; }

/* ---- hero stats ---- */
.hero-stats { display: flex; gap: 3rem; justify-content: center; margin-top: var(--s-5); }
.hero-stats div { display: flex; flex-direction: column; }
.hero-stats b { font-size: 1.8rem; font-weight: 800; color: #fff; letter-spacing: -.02em; }
.hero-stats span { color: var(--faint); font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; margin-top: .2rem; }

/* ---- client area (/me) ---- */
.profile { display: flex; align-items: center; gap: 1.1rem; }
.profile .avatar { width: 64px; height: 64px; border-radius: 50%; border: 1px solid var(--line-2); }
.me-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.4rem; }
.me-layout { display: grid; grid-template-columns: 280px 1fr; gap: var(--s-4); align-items: start; }
.profile-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.6rem; text-align: center; position: sticky; top: 5.5rem; box-shadow: var(--shadow-1); }
.profile-card .avatar { width: 88px; height: 88px; border-radius: 50%; border: 1px solid var(--line-2); margin-bottom: 1rem; }
.profile-card .pname { font-family: var(--display); font-weight: 800; font-size: 1.2rem; text-transform: uppercase; letter-spacing: -.01em; }
.profile-card .pid { color: var(--faint); font-size: .78rem; word-break: break-all; }
@media (max-width: 760px) { .me-layout { grid-template-columns: 1fr; } .profile-card { position: static; } }
.dl-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .8rem 0; border-bottom: 1px solid var(--line); }
.dl-row:last-child { border-bottom: 0; }
.dl-row b { display: block; }

/* ====================================================================
   ADMIN DENSITY — operator cockpit. Tighter than the editorial defaults;
   scoped to .admin-main so /me (.member) and the landing (.brand-page)
   keep their generous brand spacing.
   ==================================================================== */
.admin-main { padding: 1.6rem 2rem 3rem; max-width: 1320px; }
.admin-main .page-title { font-size: clamp(1.35rem, 2.4vw, 1.75rem); }
.admin-main .page-sub { font-size: .9rem; margin-bottom: 1.1rem; padding-bottom: .85rem; }

.admin-main .cards { gap: .7rem; grid-template-columns: repeat(auto-fit, minmax(155px, 1fr)); }
.admin-main .card { padding: .9rem 1rem; }
.admin-main .card .label { font-size: .66rem; }
.admin-main .card .n { font-size: 1.9rem; margin-top: .15rem; }

.admin-main .panel { padding: 1rem 1.1rem; margin-top: 1rem; }
.admin-main .panel h2, .admin-main .panel h3 { font-size: .8rem; padding-bottom: .6rem; margin-bottom: .8rem; }

.admin-main table th, .admin-main table td { padding: .45rem .65rem; font-size: .82rem; }
.admin-main table th { font-size: .63rem; letter-spacing: .07em; }
.admin-main td code { font-size: .8rem; }

.admin-main .filter-bar, .admin-main form[method="get"].row { padding: .5rem .6rem; gap: .5rem; }
.admin-main input, .admin-main select { height: 34px; font-size: .85rem; padding: .4rem .6rem; }
.admin-main .btn { padding: .45rem .8rem; font-size: .86rem; }
.admin-main .btn.sm { padding: .28rem .55rem; font-size: .77rem; }
.admin-main .actions { gap: .3rem; }
.admin-main dl.kv { gap: .4rem 1.2rem; font-size: .9rem; }

/* dashboard: use horizontal space instead of one tall stack */
.dash-grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: 1rem; align-items: start; }
.dash-grid > * { margin-top: 0; }
@media (max-width: 980px) { .dash-grid { grid-template-columns: 1fr; } }

/* ---- responsive: tablet & down ---- */
@media (max-width: 880px) {
	.admin-layout { grid-template-columns: 1fr; }
	.sidebar {
		position: sticky; top: 0; height: auto; z-index: var(--z-sticky);
		flex-direction: row; align-items: center; gap: .5rem;
		overflow-x: auto; -webkit-overflow-scrolling: touch;
		padding: .7rem 1rem; border-right: 0; border-bottom: 1px solid var(--line);
	}
	.sidebar .brand { margin-bottom: 0; flex: 0 0 auto; }
	.side-label { display: none; }
	.side-links { flex-direction: row; gap: .15rem; flex: 1 1 auto; overflow-x: auto; }
	.side-links a { white-space: nowrap; }
	.side-links a.active::before {
		left: 50%; top: auto; bottom: 0; transform: translateX(-50%);
		width: 1.4rem; height: 3px; border-radius: 3px 3px 0 0;
	}
	.side-foot { flex-direction: row; align-items: center; margin-top: 0; padding-top: 0; border-top: 0; flex: 0 0 auto; gap: .6rem; }
	.admin-main { padding: var(--s-4) 1.2rem var(--s-6); }
}

/* ---- responsive: phones ---- */
@media (max-width: 720px) {
	.nav { flex-wrap: wrap; gap: .6rem 1rem; padding: .8rem 1.1rem; }
	.nav .links { gap: 1rem; }
	.wrap { padding: var(--s-4) 1.1rem var(--s-6); }
	.panel { overflow-x: auto; }
	.panel table { min-width: 620px; }
	.hero { padding: var(--s-6) 1.1rem var(--s-5); }
}

/* ---- touch input ---- */
@media (pointer: coarse) {
	.btn { min-height: 44px; }
	.btn.sm { min-height: 44px; padding: .5rem .85rem; }
	.side-links a, .nav .links a { padding-top: .65rem; padding-bottom: .65rem; }
	.tristate label { padding: .5rem .75rem; }
	input, select, textarea { height: 44px; }
	textarea { height: auto; }
}

/* ---- htmx: progress + swap feedback ---- */
.htmx-indicator { opacity: 0; transition: opacity .15s; }
.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator { opacity: 1; }
.spinner {
	display: inline-block; width: 15px; height: 15px; vertical-align: middle;
	border: 2px solid var(--line-2); border-top-color: var(--violet);
	border-radius: 50%; animation: aurora-spin .6s linear infinite;
}
@keyframes aurora-spin { to { transform: rotate(360deg); } }
.htmx-swapping { opacity: .5; transition: opacity .12s; }
tr.htmx-swapping { opacity: .35; }
.btn.htmx-request { opacity: .6; pointer-events: none; cursor: wait; }

/* ---- top progress bar ---- */
.progress-bar {
	position: fixed; left: 0; top: 0; height: 2px; width: 100%;
	transform: scaleX(0); transform-origin: 0 50%;
	background: var(--violet); z-index: var(--z-progress);
	opacity: 0; transition: opacity .2s;
}
.progress-bar.active { opacity: 1; animation: progress-fill 1.4s ease-out forwards; }
@keyframes progress-fill { 0% { transform: scaleX(0); } 60% { transform: scaleX(.75); } 100% { transform: scaleX(.92); } }

/* ---- toast notifications ---- */
.toast-host {
	position: fixed; right: 1.2rem; bottom: 1.2rem; z-index: var(--z-toast);
	display: flex; flex-direction: column; gap: .6rem; max-width: min(360px, calc(100vw - 2rem));
}
.toast {
	padding: .8rem 1rem; border-radius: var(--radius-sm); font-size: .88rem; font-weight: 500;
	background: var(--panel-2); color: var(--text); border: 1px solid var(--line-2);
	box-shadow: var(--shadow-2);
	animation: toast-in .22s var(--ease);
}
.toast.leaving { opacity: 0; transform: translateY(6px); transition: opacity .25s, transform .25s; }
.toast-error { border-color: rgba(255,93,121,.5); }
.toast-error::before { content: "⚠ "; color: var(--red); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ---- reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	*, *::before, *::after {
		animation-duration: .01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: .01ms !important;
	}
}
