:root {
	--bg: #07050d;
	--fg: #f1ecff;
	--muted: #a99fc4;
	--accent: #8b5cf6;
	--accent2: #c084fc;
	--border: #2a2140;
	--card: #110c1d;
	--danger: #ff8fa3;
	--ok: #7ee2b8;
	--radius: 16px;
	--space: 1rem;
	--font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	--mono: ui-monospace, "JetBrains Mono", "Cascadia Code", Consolas, monospace;
	color-scheme: dark;
}
* { box-sizing: border-box; }
body {
	margin: 0;
	color: var(--fg);
	font-family: var(--font);
	line-height: 1.55;
	background: radial-gradient(900px 500px at 10% -10%, #2b1257 0%, transparent 60%),
		radial-gradient(700px 400px at 100% 0%, #1b0c3a 0%, transparent 60%), var(--bg);
	background-attachment: fixed;
	min-height: 100vh;
}
a { color: var(--accent2); }
.shell { max-width: 72rem; margin: 0 auto; padding: 1rem; }
h1, h2, h3 { letter-spacing: -0.02em; margin: 0; }
.muted { color: var(--muted); }
.accent { color: var(--accent2); }
.lede { color: var(--muted); margin: 0.4rem 0 1rem; }

.topbar {
	position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 0.75rem;
	padding: 0.7rem 1rem; background: rgba(7, 5, 13, 0.8); backdrop-filter: blur(10px);
	border-bottom: 1px solid var(--border);
}
.topbar .spacer { flex: 1; }
.burger {
	width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px;
	background: var(--card); border: 1px solid var(--border); color: var(--fg); cursor: pointer; font-size: 1.2rem;
}
.logo { font-weight: 800; font-size: 1.25rem; display: flex; align-items: center; gap: 0.45rem; cursor: pointer; }
.logo-mark {
	width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px;
	background: linear-gradient(135deg, var(--accent), #5b21b6); box-shadow: 0 0 18px rgba(139, 92, 246, 0.55);
	font-size: 0.95rem;
}
.hero { padding: 1.5rem 0 1rem; }
.hero h1 { font-size: clamp(1.9rem, 7vw, 3rem); }
.stat {
	display: inline-flex; gap: 0.4rem; padding: 0.3rem 0.8rem; border-radius: 999px;
	border: 1px solid var(--border); background: var(--card); color: var(--muted); margin-bottom: 1rem;
}
.stat strong { color: var(--accent2); }

.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
	padding: 0.65rem 1rem; border: 1px solid transparent; border-radius: 12px;
	background: linear-gradient(135deg, var(--accent), #6d28d9); color: #fff; font: inherit;
	font-weight: 600; cursor: pointer; transition: box-shadow 0.2s, transform 0.1s; min-height: 42px;
}
.btn:hover { box-shadow: 0 0 20px rgba(139, 92, 246, 0.45); }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.6; cursor: default; }
.btn-secondary { background: var(--card); border-color: var(--border); color: var(--fg); }
.btn-danger { background: transparent; border-color: #5b2333; color: var(--danger); }
.btn-sm { padding: 0.4rem 0.7rem; min-height: 34px; font-size: 0.875rem; }

.card {
	padding: 1rem; border: 1px solid var(--border); border-radius: var(--radius);
	background: linear-gradient(180deg, #140e22, var(--card));
}
.input, .select, .textarea {
	width: 100%; padding: 0.7rem 0.85rem; border: 1px solid var(--border); border-radius: 12px;
	background: #0c0816; color: var(--fg); font: inherit; font-size: 16px;
}
.textarea { min-height: 7rem; resize: vertical; }
.textarea.mono { font-family: var(--mono); font-size: 14px; min-height: 12rem; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px rgba(139,92,246,.2); }
.search { font-size: 16px; padding: 0.9rem 1rem; }
.field { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.35rem; margin-bottom: 1rem; }
.field > label { font-size: 0.875rem; color: var(--muted); }
.stack { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; }
:where(.field, .stack, .list) > * { min-width: 0; }
.row { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(21rem, 100%), 1fr)); }

.chips { display: flex; gap: 0.5rem; overflow-x: auto; padding: 0.75rem 0 0.25rem; }
.chip {
	flex: none; padding: 0.45rem 0.85rem; border-radius: 999px; border: 1px solid var(--border);
	background: var(--card); color: var(--fg); font: inherit; font-size: 0.9rem; cursor: pointer;
}
.chip.on { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 14px rgba(139,92,246,.5); }
.chip.on .muted { color: #e9ddff; }

.script-card { display: flex; flex-direction: column; gap: 0.6rem; transition: border-color 0.2s, box-shadow 0.2s; animation: rise .3s ease both; }
.script-card:hover { border-color: #4c3480; box-shadow: 0 0 24px rgba(139, 92, 246, 0.15); }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
.script-head { display: flex; justify-content: space-between; gap: 0.5rem; align-items: flex-start; }
.script-head h3 { font-size: 1.08rem; overflow-wrap: anywhere; }
.creator { display: flex; align-items: center; gap: 0.45rem; font-size: 0.9rem; flex-wrap: wrap; }
.creator a { color: var(--fg); text-decoration: none; font-weight: 600; }
.desc { margin: 0; color: var(--muted); font-size: 0.93rem; overflow-wrap: anywhere; }
.code {
	margin: 0; padding: 0.8rem; background: #05030a; border: 1px solid var(--border); border-radius: 12px;
	font-family: var(--mono); font-size: 0.82rem; max-height: 14rem; overflow: auto; white-space: pre; color: #d8ccff;
}
.copy-btn { width: 100%; }
.avatar {
	width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; flex: none;
	background: linear-gradient(135deg, var(--accent), #4c1d95); font-weight: 700; overflow: hidden; font-size: 1.6rem;
	box-shadow: 0 0 20px rgba(139,92,246,.35);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.sm { width: 26px; height: 26px; font-size: 0.8rem; box-shadow: none; }

.badge {
	display: inline-block; padding: 0.12rem 0.55rem; border-radius: 999px; font-size: 0.78rem; flex: none;
	border: 1px solid #4c3480; color: var(--accent2); background: rgba(139, 92, 246, 0.1);
}
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 40; animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.drawer {
	position: fixed; top: 0; left: 0; bottom: 0; width: min(290px, 84vw); z-index: 50; padding: 1rem;
	background: #0d0918; border-right: 1px solid var(--border); display: flex; flex-direction: column; gap: 0.3rem;
	animation: slide .22s ease; box-shadow: 0 0 40px rgba(139,92,246,.2);
}
@keyframes slide { from { transform: translateX(-100%); } }
.drawer button.nav {
	text-align: left; padding: 0.8rem 0.9rem; border-radius: 12px; border: 0; background: transparent;
	color: var(--fg); font: inherit; font-size: 1rem; cursor: pointer;
}
.drawer button.nav:hover, .drawer button.nav.on { background: rgba(139,92,246,.15); color: var(--accent2); }
.page { max-width: 40rem; margin: 0 auto; padding: 1.25rem 1rem 3rem; }
.page h1 { font-size: 1.6rem; margin-bottom: 1rem; }
.section-title { font-size: 1.05rem; margin: 0 0 0.75rem; }
.alert { padding: 0.7rem 0.9rem; border: 1px solid var(--border); border-radius: 12px; display: flex; gap: .75rem; flex-wrap: wrap; justify-content: space-between; align-items: center; }
.alert-error { border-color: #5b2333; color: var(--danger); background: rgba(255,80,110,.06); }
.alert-ok { border-color: #1e5a44; color: var(--ok); background: rgba(80,255,180,.06); }
.list { display: grid; gap: 0.5rem; margin: 0; padding: 0; list-style: none; }
.list-item { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; flex-wrap: wrap; padding: 0.75rem; border: 1px solid var(--border); border-radius: 12px; background: var(--card); }
.empty { padding: 2rem; text-align: center; color: var(--muted); }
.empty-title { margin: 0 0 0.25rem; color: var(--fg); font-weight: 600; }
.loading { display: flex; align-items: center; justify-content: center; gap: 0.6rem; padding: 1.5rem; color: var(--muted); }
.spinner { width: 1.15rem; height: 1.15rem; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.check { display: flex; gap: 0.6rem; align-items: center; margin-bottom: 0.8rem; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; } }
:where(a, button, input, select, textarea):focus-visible { outline: 2px solid var(--accent2); outline-offset: 2px; }
