/* Arcline Video: a template board: masonry feed, template pages, saves. */

:root {
	--bg: #ffffff;
	--card: #ffffff;
	--text: #111111;
	--muted: #5f5f5f;
	--soft: #e9e9e9;
	--soft-hover: #dadada;
	--line: #e9e9e9;
	--ink: #111111;
	--ink-text: #ffffff;
	--save: #e60023;
	--save-hover: #b60000;
	--focus: #0074e8;
	--placeholder: #efefef;
	--shade: rgba(0, 0, 0, 0.32);
	--card-shadow: 0 1px 20px rgba(0, 0, 0, 0.1);
	--pop-shadow: 0 0 0 1px rgba(0, 0, 0, 0.04), 0 8px 28px rgba(0, 0, 0, 0.16);
	--chip-0: #f6e1d6;
	--chip-1: #dbe8d3;
	--chip-2: #d6e2f1;
	--chip-3: #efe3c4;
	--chip-4: #e6dcef;
	--chip-5: #d5ece8;
	--chip-6: #f2d9df;
	--chip-7: #e3e3d5;
	--gap: 16px;
	--pad: 16px;
	--font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif;
	--mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	color-scheme: light;
}

@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) {
		--bg: #121212;
		--card: #1c1c1c;
		--text: #f1f1f1;
		--muted: #b0b0b0;
		--soft: #2e2e2e;
		--soft-hover: #3b3b3b;
		--line: #2e2e2e;
		--ink: #f1f1f1;
		--ink-text: #111111;
		--focus: #5aa2ff;
		--placeholder: #242424;
		--shade: rgba(0, 0, 0, 0.42);
		--card-shadow: 0 0 0 1px #2a2a2a;
		--pop-shadow: 0 0 0 1px #333, 0 8px 28px rgba(0, 0, 0, 0.5);
		--chip-0: #4a3328;
		--chip-1: #2f3f29;
		--chip-2: #27364a;
		--chip-3: #453b20;
		--chip-4: #3a2f47;
		--chip-5: #22403b;
		--chip-6: #482a33;
		--chip-7: #3a3a2c;
		color-scheme: dark;
	}
}
:root[data-theme="dark"] {
	--bg: #121212;
	--card: #1c1c1c;
	--text: #f1f1f1;
	--muted: #b0b0b0;
	--soft: #2e2e2e;
	--soft-hover: #3b3b3b;
	--line: #2e2e2e;
	--ink: #f1f1f1;
	--ink-text: #111111;
	--focus: #5aa2ff;
	--placeholder: #242424;
	--shade: rgba(0, 0, 0, 0.42);
	--card-shadow: 0 0 0 1px #2a2a2a;
	--pop-shadow: 0 0 0 1px #333, 0 8px 28px rgba(0, 0, 0, 0.5);
	--chip-0: #4a3328;
	--chip-1: #2f3f29;
	--chip-2: #27364a;
	--chip-3: #453b20;
	--chip-4: #3a2f47;
	--chip-5: #22403b;
	--chip-6: #482a33;
	--chip-7: #3a3a2c;
	color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font: 16px/1.4 var(--font);
	-webkit-font-smoothing: antialiased;
	overflow-x: hidden;
}
a { color: inherit; }
button { font: inherit; color: inherit; }
img, video, svg { display: block; }
svg { flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
svg.fill { fill: currentColor; stroke: none; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
main:focus { outline: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------------------------------------------------------------- header */
.top {
	position: sticky;
	top: 0;
	z-index: 30;
	display: flex;
	align-items: center;
	gap: 8px;
	height: 80px;
	padding: 0 var(--pad);
	background: var(--bg);
}
.brand {
	display: flex;
	align-items: center;
	gap: 10px;
	height: 48px;
	padding: 0 10px 0 4px;
	border-radius: 24px;
	text-decoration: none;
	font-weight: 700;
	font-size: 19px;
	letter-spacing: -0.01em;
	white-space: nowrap;
}
.brand img { width: 32px; height: 32px; border-radius: 9px; }
.nav { display: flex; gap: 2px; }
.nav-pill {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	height: 48px;
	padding: 0 16px;
	border-radius: 24px;
	font-weight: 600;
	text-decoration: none;
	white-space: nowrap;
}
.nav-pill:hover { background: var(--soft); }
.nav-pill[aria-current="page"] { background: var(--ink); color: var(--ink-text); }
.count {
	display: inline-grid;
	place-items: center;
	min-width: 20px;
	height: 20px;
	padding: 0 6px;
	border-radius: 10px;
	background: var(--save);
	color: #fff;
	font-size: 12px;
	font-weight: 700;
}
.count:empty { display: none; }

.search {
	position: relative;
	flex: 1;
	min-width: 0;
	display: flex;
	align-items: center;
	gap: 10px;
	height: 48px;
	margin: 0 0 0 6px;
	padding: 0 8px 0 16px;
	border-radius: 24px;
	background: var(--soft);
}
.search:hover { background: var(--soft-hover); }
.search:focus-within { background: var(--soft); box-shadow: 0 0 0 4px color-mix(in srgb, var(--focus) 45%, transparent); }
.search-icon { color: var(--muted); }
.search input {
	flex: 1;
	min-width: 0;
	height: 100%;
	border: 0;
	background: transparent;
	color: inherit;
	font: inherit;
	outline: none;
}
.search input::placeholder { color: var(--muted); }
.search input::-webkit-search-cancel-button { appearance: none; }
.search-clear {
	display: grid;
	place-items: center;
	width: 32px;
	height: 32px;
	border: 0;
	border-radius: 50%;
	background: transparent;
	cursor: pointer;
}
.search-clear:hover { background: var(--soft-hover); }
.search-clear[hidden] { display: none; }

.ideas {
	position: absolute;
	top: calc(100% + 10px);
	left: 0;
	right: 0;
	max-height: min(70vh, 640px);
	overflow: auto;
	padding: 20px 24px 24px;
	border-radius: 16px;
	background: var(--card);
	box-shadow: var(--pop-shadow);
}
.ideas[hidden] { display: none; }
.ideas h3 { margin: 4px 0 12px; font-size: 16px; font-weight: 600; }
.ideas-block + .ideas-block { margin-top: 20px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	height: 40px;
	padding: 0 16px;
	border: 0;
	border-radius: 20px;
	background: var(--soft);
	font-weight: 600;
	font-size: 15px;
	text-decoration: none;
	white-space: nowrap;
	cursor: pointer;
}
.chip:hover { background: var(--soft-hover); }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.tile {
	position: relative;
	display: block;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	border-radius: 16px;
	background: var(--placeholder);
	text-decoration: none;
}
.tile img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.tile:hover img { transform: scale(1.04); }
.tile::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 30%, rgba(0, 0, 0, 0.6)); }
.tile span { position: absolute; left: 12px; bottom: 10px; z-index: 1; color: #fff; font-weight: 700; font-size: 16px; }
.suggest { display: flex; flex-direction: column; margin: -8px -12px; }
.suggest a, .suggest button {
	display: flex;
	align-items: center;
	gap: 12px;
	width: 100%;
	padding: 8px 12px;
	border: 0;
	border-radius: 12px;
	background: transparent;
	text-align: left;
	text-decoration: none;
	cursor: pointer;
}
.suggest a:hover, .suggest button:hover, .suggest .on { background: var(--soft); }
.suggest img { width: 48px; height: 48px; border-radius: 10px; object-fit: cover; background: var(--placeholder); }
.suggest .glass { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 10px; background: var(--soft); }
.suggest b { display: block; font-weight: 600; }
.suggest small { color: var(--muted); font-size: 13px; }

/* ---------------------------------------------------------------- tabs, headings */
.tabs {
	display: flex;
	gap: 28px;
	padding: 4px calc(var(--pad) + 8px) 0;
	overflow-x: auto;
	scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
	position: relative;
	padding: 10px 0 14px;
	font-weight: 600;
	text-decoration: none;
	white-space: nowrap;
}
.tab:hover { color: var(--muted); }
.tab[aria-current="page"]::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 4px;
	height: 3px;
	border-radius: 2px;
	background: var(--text);
}
.tab[aria-current="page"]:hover { color: inherit; }

.page-head { padding: 24px var(--pad) 8px; text-align: center; }
.page-head h1 { margin: 0; font-size: clamp(28px, 4vw, 40px); font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; }
.page-head p { margin: 8px 0 0; color: var(--muted); }
.page-head .chips { justify-content: center; margin-top: 16px; }
.guided { display: flex; gap: 8px; padding: 8px var(--pad) 4px; overflow-x: auto; scrollbar-width: none; }
.guided::-webkit-scrollbar { display: none; }
.guided .chip { color: var(--text); }
.c0 { background: var(--chip-0) !important; } .c1 { background: var(--chip-1) !important; }
.c2 { background: var(--chip-2) !important; } .c3 { background: var(--chip-3) !important; }
.c4 { background: var(--chip-4) !important; } .c5 { background: var(--chip-5) !important; }
.c6 { background: var(--chip-6) !important; } .c7 { background: var(--chip-7) !important; }
.guided .chip:hover { filter: brightness(0.95); }

/* ---------------------------------------------------------------- masonry */
.board-wrap { padding: 12px var(--pad) 40px; }
.board { display: flex; align-items: flex-start; gap: var(--gap); }
.col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: var(--gap); }
.end { margin: 8px 0 48px; color: var(--muted); text-align: center; font-size: 14px; }

.template { position: relative; }
.template-frame { position: relative; border-radius: 16px; }
.template-link {
	position: relative;
	display: block;
	overflow: hidden;
	border-radius: 16px;
	background: var(--placeholder);
	cursor: zoom-in;
}
.template-link video { width: 100%; height: 100%; object-fit: cover; }
/* A hairline so white films keep their edge on a white page. */
.template-link::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06); pointer-events: none; }
.template-shade {
	position: absolute;
	inset: 0;
	border-radius: 16px;
	background: var(--shade);
	opacity: 0;
	transition: opacity 0.15s;
	pointer-events: none;
}
.dur, .mark.badge {
	position: absolute;
	bottom: 10px;
	display: inline-flex;
	align-items: center;
	gap: 4px;
	height: 24px;
	padding: 0 8px;
	border-radius: 12px;
	background: rgba(0, 0, 0, 0.55);
	color: #fff;
	font-size: 12px;
	font-weight: 600;
	font-variant-numeric: tabular-nums;
}
.dur { left: 10px; pointer-events: none; }
.mark.badge { right: 10px; }
.mark {
	border: 0;
	font-family: inherit;
	font-variant-numeric: tabular-nums;
	cursor: pointer;
}
.mark[hidden], .save-btn[hidden] { display: none; }
.mark.badge:hover { background: rgba(0, 0, 0, 0.78); }
.mark svg.full { fill: currentColor; }
.mark.badge svg.full { color: #ff4d6d; }
.mark.big {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	height: 48px;
	min-width: 48px;
	padding: 0 13px;
	border-radius: 24px;
	background: transparent;
	font-weight: 600;
}
.mark.big:hover { background: var(--soft); }
.mark.big svg.full { color: var(--save); }
.mark.pop svg { animation: pop 0.35s ease-out; }
@keyframes pop { 40% { transform: scale(1.35); } }
@media (hover: hover) {
	.template-frame:hover .template-shade, .template-frame:focus-within .template-shade { opacity: 1; }
}

.avatar {
	display: inline-grid;
	place-items: center;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	font-weight: 700;
	flex: none;
	text-transform: uppercase;
	object-fit: cover;
	background: var(--placeholder);
}
img.avatar { box-shadow: inset 0 0 0 1px rgba(127, 127, 127, 0.2); }

/* ---------------------------------------------------------------- buttons */
.save-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 44px;
	padding: 0 16px;
	border: 0;
	border-radius: 22px;
	background: var(--save);
	color: #fff;
	font-weight: 600;
	cursor: pointer;
}
.save-btn:hover { background: var(--save-hover); }
.save-btn.big { height: 48px; padding: 0 20px; border-radius: 24px; font-size: 16px; }
.round-btn {
	display: grid;
	place-items: center;
	width: 32px;
	height: 32px;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.92);
	color: #111;
	cursor: pointer;
	text-decoration: none;
}
.round-btn:hover { background: #fff; }
.round-btn.ghost { background: transparent; color: inherit; }
.round-btn.ghost:hover { background: var(--soft); }
.round-btn.lg { width: 48px; height: 48px; }
.pill {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	height: 44px;
	padding: 0 18px;
	border: 0;
	border-radius: 22px;
	background: var(--soft);
	font-weight: 600;
	text-decoration: none;
	white-space: nowrap;
	cursor: pointer;
}
.pill:hover { background: var(--soft-hover); }
.pill.ink { background: var(--ink); color: var(--ink-text); }
.pill.ink:hover { opacity: 0.88; }

/* ---------------------------------------------------------------- menu, toast */
.menu {
	position: fixed;
	z-index: 50;
	min-width: 228px;
	padding: 8px;
	border-radius: 16px;
	background: var(--card);
	box-shadow: var(--pop-shadow);
}
.menu[hidden] { display: none; }
.menu p { margin: 4px 8px 8px; color: var(--muted); font-size: 12px; }
.menu a, .menu button {
	display: flex;
	align-items: center;
	gap: 12px;
	width: 100%;
	padding: 10px 12px;
	border: 0;
	border-radius: 8px;
	background: transparent;
	font-size: 15px;
	font-weight: 600;
	text-align: left;
	text-decoration: none;
	cursor: pointer;
}
.menu a:hover, .menu button:hover, .menu a:focus-visible, .menu button:focus-visible { background: var(--soft); outline: none; }
.menu small { margin-left: auto; color: var(--muted); font-weight: 500; font-size: 12px; }

.toast {
	position: fixed;
	left: 50%;
	bottom: 24px;
	z-index: 60;
	display: flex;
	align-items: center;
	gap: 12px;
	max-width: calc(100vw - 32px);
	padding: 10px 18px 10px 10px;
	border-radius: 16px;
	background: var(--ink);
	color: var(--ink-text);
	font-weight: 600;
	font-size: 15px;
	box-shadow: 0 8px 28px rgba(0, 0, 0, 0.25);
	transform: translate(-50%, 140%);
	opacity: 0;
	transition: transform 0.25s, opacity 0.25s;
	pointer-events: none;
}
.toast.no-thumb { padding-left: 18px; }
.toast.on { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
.toast img { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; }
.toast a { margin-left: 8px; padding: 8px 14px; border-radius: 16px; background: var(--ink-text); color: var(--ink); text-decoration: none; }

/* ---------------------------------------------------------------- template page */
.closeup-wrap { position: relative; padding: 8px var(--pad) 0; }
.back {
	position: absolute;
	top: 8px;
	left: var(--pad);
	z-index: 2;
}
.closeup {
	display: grid;
	grid-template-columns: minmax(0, 1.25fr) minmax(460px, 1fr);
	max-width: 1320px;
	margin: 0 auto;
	border-radius: 32px;
	background: var(--card);
	box-shadow: var(--card-shadow);
}
.cu-media { align-self: start; position: sticky; top: 88px; padding: 16px; }
.cu-media video {
	width: 100%;
	height: auto;
	border-radius: 20px;
	background: var(--placeholder);
}
.cu-side { min-width: 0; padding: 28px 28px 32px 16px; }
.cu-side h1 { margin: 0 0 10px; font-size: 28px; font-weight: 600; line-height: 1.2; letter-spacing: -0.01em; }
.cu-side .lead { margin: 0; color: var(--muted); font-size: 16px; line-height: 1.55; }
.by { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: 16px 0 0; font-size: 15px; }
.by a { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; text-decoration: none; }
.by a:hover span { text-decoration: underline; }
.remix-of { color: var(--muted); }
.remix-of a { font-weight: 600; color: var(--text); }

/* Buttons in 21st's order: Copy prompt (with its menu), Save, Remix, CLI, Report. */
.actions-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 20px 0 0; font-size: 15px; }
.actions-row svg { width: 17px; height: 17px; }
.split { display: inline-flex; }
.primary-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	height: 44px;
	padding: 0 14px 0 12px;
	border: 0;
	border-radius: 22px 0 0 22px;
	background: var(--save);
	color: #fff;
	font-weight: 600;
	white-space: nowrap;
	cursor: pointer;
}
.primary-btn:hover { background: var(--save-hover); }
.primary-btn.caret { padding: 0 10px 0 8px; border-radius: 0 22px 22px 0; border-left: 1px solid rgba(255, 255, 255, 0.35); }
.primary-btn.solo { border-radius: 22px; }
.mark.labeled {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	height: 44px;
	padding: 0 14px 0 12px;
	margin-left: 4px;
	border: 1px solid #cdcdcd;
	border-radius: 22px;
	background: var(--card);
	color: var(--text);
	font-weight: 600;
}
.mark.labeled:hover { background: var(--soft); }
.mark.labeled b { font-weight: 600; }
.mark.labeled .n { color: var(--muted); font-weight: 500; }
.mark.labeled svg.full { color: var(--save); }
.pill.remix { height: 44px; padding: 0 14px 0 12px; font-size: 15px; }
.ghost-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	height: 44px;
	padding: 0 9px;
	border: 0;
	border-radius: 22px;
	background: transparent;
	color: var(--muted);
	font-weight: 600;
	cursor: pointer;
}
.ghost-btn:hover { background: var(--soft); color: var(--text); }
.cli-pop { padding: 6px 8px 4px; max-width: 420px; }
.cli-pop p { margin: 0 0 8px; }
.cli-pop pre { margin: 0 0 6px; padding: 10px 12px; border-radius: 10px; background: #0e0e10; color: #e8e8ea; overflow-x: auto; }
.cli-pop code { padding: 0; background: none; color: inherit; font-size: 12.5px; line-height: 1.6; overflow-wrap: normal; white-space: pre; }

/* Code: always dark, like a code editor. */
.code { position: relative; margin: 24px 0 0; border-radius: 16px; background: #0e0e10; color: #e6e6e9; overflow: hidden; }
.code-head { display: flex; align-items: center; gap: 8px; padding: 8px 8px 0 8px; border-bottom: 1px solid #232327; }
.code-tabs { display: flex; gap: 2px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.code-tab {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 12px 9px;
	border: 0;
	border-bottom: 2px solid transparent;
	background: none;
	color: #9a9aa3;
	font-family: var(--mono);
	font-size: 12.5px;
	white-space: nowrap;
	cursor: pointer;
}
.code-tab[aria-selected="true"] { color: #fff; border-bottom-color: #fff; }
.code-tab:disabled { cursor: default; opacity: 0.6; }
.code-tab.skel-line { width: 90px; height: 14px; margin: 10px 8px; padding: 0; border-radius: 4px; background: #232327; }
.code-copy { display: inline-flex; align-items: center; gap: 6px; height: 30px; margin-bottom: 6px; padding: 0 10px; border: 1px solid #2c2c31; border-radius: 8px; background: #17171a; color: #e6e6e9; font-size: 13px; font-weight: 600; cursor: pointer; }
.code-copy:hover { background: #222226; }
.code-body { margin: 0; max-height: 420px; min-height: 120px; padding: 14px 16px; overflow: auto; }
.code-body code { padding: 0; background: none; color: inherit; font-size: 12.5px; line-height: 1.6; white-space: pre; overflow-wrap: normal; }
.code.locked .code-body { max-height: 260px; overflow: hidden; -webkit-mask-image: linear-gradient(#000 35%, transparent 92%); mask-image: linear-gradient(#000 35%, transparent 92%); }
.code-lock {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
	padding: 72px 16px 20px;
	background: linear-gradient(rgba(14, 14, 16, 0), #0e0e10 55%);
	text-align: center;
	color: #fff;
}
.code-lock b { font-weight: 600; }
.tk-c { color: #7d7f8a; }
.tk-t { color: #7cc4ff; }
.tk-a { color: #f5b971; }
.tk-s { color: #a6e3a1; }

.meta-grid { display: grid; grid-template-columns: 1fr auto; gap: 16px 24px; margin: 24px 0 0; }
.meta-grid h3, .meta-one h3 { margin: 0 0 10px; font-size: 15px; font-weight: 600; }
.meta-one { margin: 18px 0 0; }
.meta-one p { margin: 0; }
.chips.small .chip { height: 32px; padding: 0 12px; border-radius: 10px; font-size: 13px; font-weight: 500; color: var(--muted); }
.chips.small span.chip { color: var(--text); cursor: default; }
.remix-note { display: flex; align-items: center; gap: 8px; margin: -6px 4px 18px; color: var(--muted); }
.remix-note a { color: var(--text); font-weight: 600; }
code { font-family: var(--mono); font-size: 0.88em; padding: 1px 5px; border-radius: 6px; background: var(--soft); overflow-wrap: anywhere; }
.more-title { margin: 44px 0 4px; text-align: center; font-size: 20px; font-weight: 600; }

/* ---------------------------------------------------------------- states */
.empty { max-width: 460px; margin: 64px auto; padding: 0 var(--pad); text-align: center; }
.empty h1 { margin: 0 0 8px; font-size: 28px; font-weight: 600; }
.empty p { margin: 0 0 20px; color: var(--muted); }
.skel { border-radius: 16px; background: var(--placeholder); animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.55; } }

/* ---------------------------------------------------------------- small screens */
@media (max-width: 1100px) {
	.closeup { grid-template-columns: minmax(0, 1fr) minmax(380px, 1fr); }
}
@media (max-width: 860px) {
	.brand span { display: none; }
	.nav-pill[data-nav="saved"] { display: none; }
	.closeup { grid-template-columns: 1fr; border-radius: 24px; }
	.cu-media { position: static; padding: 12px; }
	.cu-media video { border-radius: 16px; }
	.cu-side { padding: 8px 20px 24px; }
	.back { position: static; margin-bottom: 8px; }
}
@media (max-width: 600px) {
	:root { --gap: 8px; --pad: 8px; }
	.top { height: 64px; gap: 4px; }
	.nav-pill { height: 40px; padding: 0 12px; }
	.search { height: 40px; margin-left: 2px; padding-left: 12px; }
	.ideas { position: fixed; top: 64px; left: 8px; right: 8px; padding: 16px; }
	.tabs { gap: 22px; padding-left: 16px; padding-right: 16px; }
	.template-link, .template-frame, .template-shade { border-radius: 14px; }
	.dur, .mark.badge { bottom: 8px; }
	.dur { left: 8px; }
	.mark.badge { right: 8px; }
	.cu-side h1 { font-size: 24px; }
	.account .signup-btn, .nav-create { display: none; }
	.account .save-btn { height: 40px; padding: 0 14px; }
	.create-grid { grid-template-columns: 1fr; }
	.profile h1 { font-size: 30px; }
	.dialog { padding: 24px 18px; }
}
@media (max-width: 380px) {
	.nav-pill[data-nav="home"] { display: none; }
}
@media (prefers-reduced-motion: reduce) {
	* { transition: none !important; animation: none !important; }
}

/* ---------------------------------------------------------------- account area */
.account { display: flex; align-items: center; gap: 8px; flex: none; }
.account .save-btn { height: 48px; padding: 0 18px; border-radius: 24px; font-size: 16px; }
.signup-btn { height: 48px; padding: 0 18px; border-radius: 24px; font-size: 16px; }
.avatar-btn {
	display: grid;
	place-items: center;
	width: 48px;
	height: 48px;
	border: 0;
	border-radius: 50%;
	background: transparent;
	cursor: pointer;
}
.avatar-btn:hover { background: var(--soft); }
.menu-head { padding: 8px 12px 12px !important; border-bottom: 1px solid var(--line); border-radius: 12px 12px 0 0 !important; margin-bottom: 6px; }
.menu-head b { display: block; font-size: 16px; }
.menu-head small { color: var(--muted); margin-left: 0 !important; font-size: 13px; font-weight: 500; }
.menu .danger { color: var(--save); }

/* ---------------------------------------------------------------- dialogs */
.dialog {
	width: min(560px, calc(100vw - 24px));
	max-height: calc(100dvh - 48px);
	padding: 28px 32px;
	border: 0;
	border-radius: 32px;
	background: var(--card);
	color: var(--text);
	box-shadow: 0 16px 48px rgba(0, 0, 0, 0.3);
	overflow: auto;
}
.dialog.narrow { width: min(484px, calc(100vw - 24px)); }
.dialog::backdrop { background: rgba(0, 0, 0, 0.6); }
.dialog h2 { margin: 0 0 6px; font-size: 24px; font-weight: 600; text-align: center; }
.dialog > .muted { text-align: center; margin: 0 0 16px; }
.dialog-x { position: absolute; top: 14px; right: 14px; }
.dialog .loading { padding: 32px 0; }
.muted { color: var(--muted); }
.linkish { padding: 0; border: 0; background: none; font: inherit; font-weight: 600; color: inherit; cursor: pointer; }
.linkish:hover { text-decoration: underline; }

.auth { display: flex; flex-direction: column; align-items: stretch; max-width: 300px; margin: 0 auto; }
.auth-logo { width: 40px; height: 40px; border-radius: 11px; margin: 4px auto 14px; }
.auth h2 { font-size: 28px; line-height: 1.15; letter-spacing: -0.01em; }
.auth > .muted { text-align: center; margin: 4px 0 18px; }
.auth-form { display: flex; flex-direction: column; gap: 10px; }
.or { position: relative; margin: 14px 0; text-align: center; font-size: 13px; font-weight: 700; }
.oauth-list { display: flex; flex-direction: column; gap: 8px; }
.oauth {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	height: 44px;
	padding: 0 16px;
	border: 1px solid #cdcdcd;
	border-radius: 22px;
	background: #fff;
	color: #111;
	font-weight: 600;
	text-decoration: none;
}
.oauth:hover { background: #f5f5f5; }
.oauth .logo { position: absolute; left: 14px; }
.oauth { position: relative; }
.switch { margin: 18px 0 2px; text-align: center; font-size: 14px; }
svg.logo { stroke: none; }

/* ---------------------------------------------------------------- forms */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; margin: 0; padding: 0; border: 0; }
.field > span:first-child, .field > legend { padding: 0 0 0 6px; font-size: 13px; font-weight: 500; }
.field legend small { color: var(--muted); }
.field input, .field textarea, .field select, input.text, .inline-form input {
	width: 100%;
	min-height: 48px;
	padding: 12px 16px;
	border: 2px solid #cdcdcd;
	border-radius: 16px;
	background: var(--card);
	color: var(--text);
	font: inherit;
	resize: vertical;
}
.field textarea { line-height: 1.45; }
.field input:focus, .field textarea:focus, .field select:focus, input.text:focus, .inline-form input:focus {
	outline: none;
	border-color: var(--focus);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 35%, transparent);
}
.field > small { padding-left: 6px; font-size: 12px; }
.prefixed { position: relative; display: block; }
.prefixed i { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); font-style: normal; color: var(--muted); }
.prefixed input { padding-left: 32px; }
.form-error { margin: 0; padding: 10px 14px; border-radius: 12px; background: color-mix(in srgb, var(--save) 12%, transparent); color: var(--save); font-size: 14px; font-weight: 500; }
.form-error[hidden] { display: none; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row-end { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.check, .radio { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.checks .check span {
	display: inline-flex;
	align-items: center;
	height: 36px;
	padding: 0 14px;
	border-radius: 18px;
	background: var(--soft);
	font-size: 14px;
	font-weight: 600;
}
.checks .check input { position: absolute; opacity: 0; pointer-events: none; }
.checks .check input:checked + span { background: var(--ink); color: var(--ink-text); }
.checks .check input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.check.rights { align-items: flex-start; font-size: 14px; line-height: 1.45; }
.check input, .radio input { width: 20px; height: 20px; margin: 0; accent-color: var(--ink); flex: none; }
.radio { padding: 10px 12px; border-radius: 12px; }
.radio:hover { background: var(--soft); }
.save-btn.wide { width: 100%; }
.save-btn:disabled, .pill:disabled { opacity: 0.55; cursor: default; }
.pill.small { height: 36px; padding: 0 14px; font-size: 14px; }
.pill.danger { color: var(--save); }
a.save-btn { text-decoration: none; }

/* ---------------------------------------------------------------- follow */
.follow-btn {
	flex: none;
	height: 44px;
	padding: 0 18px;
	border: 0;
	border-radius: 22px;
	background: var(--save);
	color: #fff;
	font-weight: 600;
	cursor: pointer;
}
.follow-btn:hover { background: var(--save-hover); }
.follow-btn[aria-pressed="true"] { background: var(--ink); color: var(--ink-text); }
.follow-btn.big { height: 48px; padding: 0 22px; font-size: 16px; }
.follow-btn.small { height: 36px; padding: 0 14px; font-size: 14px; }

/* ---------------------------------------------------------------- profile */
.profile { display: flex; flex-direction: column; align-items: center; padding: 24px var(--pad) 4px; text-align: center; }
.profile-avatar { margin-bottom: 14px; }
.profile h1 { margin: 0; font-size: 36px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; }
.profile .handle { display: inline-flex; align-items: center; gap: 6px; margin: 8px 0 0; color: var(--muted); font-size: 14px; }
.profile .bio { max-width: 560px; margin: 12px 0 0; white-space: pre-line; }
.profile .website { margin-top: 6px; font-weight: 600; text-decoration: none; }
.profile .website:hover { text-decoration: underline; }
.profile .stats { display: flex; gap: 8px; margin: 12px 0 0; }
.profile-actions { display: flex; gap: 8px; margin: 18px 0 8px; }
.tabs.center { justify-content: center; margin-top: 8px; }
.uploads { max-width: 720px; margin: 8px auto 0; padding: 0 var(--pad); }
.uploads h2 { margin: 12px 0 8px; font-size: 18px; font-weight: 600; }
.upload-row { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 4px 12px; padding: 12px 14px; margin-bottom: 8px; border-radius: 16px; background: var(--soft); }
.upload-row small { grid-column: 2 / 3; color: var(--muted); }
.upload-row .pill { grid-column: 3; grid-row: 1 / span 2; }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; }
.status.failed { color: var(--save); }
.people { display: flex; flex-direction: column; gap: 4px; margin-top: 12px; }
.person { display: flex; align-items: center; gap: 12px; }
.person a { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; padding: 6px; border-radius: 14px; text-decoration: none; }
.person a:hover { background: var(--soft); }
.person b { display: block; }
.person small { color: var(--muted); }

/* ---------------------------------------------------------------- loading */
.loading { display: grid; place-items: center; padding: 80px 0; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--soft); border-top-color: var(--text); animation: spin 0.8s linear infinite; }
.spinner.small { width: 14px; height: 14px; border-width: 2px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------- create */
.create { max-width: 1080px; margin: 0 auto; padding: 8px var(--pad) 48px; }
.create-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 4px 18px; }
.create-head h1 { margin: 0; font-size: 24px; font-weight: 600; }
.create-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 32px; align-items: start; }
.drop-col { display: flex; flex-direction: column; gap: 10px; align-items: center; position: sticky; top: 96px; }
.drop {
	position: relative;
	display: grid;
	place-items: center;
	width: 100%;
	min-height: 420px;
	border: 2px dashed #cdcdcd;
	border-radius: 32px;
	background: var(--soft);
	text-align: center;
	cursor: pointer;
	overflow: hidden;
}
.drop:hover, .drop.over { border-color: var(--text); }
.drop-empty { display: flex; flex-direction: column; align-items: center; gap: 10px; max-width: 260px; padding: 24px; }
.drop-empty b { font-size: 16px; font-weight: 600; }
.drop-empty small { color: var(--muted); font-size: 13px; line-height: 1.45; }
.drop.has-film { min-height: 0; border-style: solid; border-color: transparent; background: #000; }
.drop.has-film .drop-empty { display: none; }
.drop-preview { width: 100%; max-height: 70vh; display: block; }
.fields { display: flex; flex-direction: column; gap: 16px; }
.file-pick { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; cursor: pointer; }
.file-pick-btn { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 16px; border-radius: 22px; background: var(--soft); font-weight: 600; }
.file-pick:hover .file-pick-btn { background: var(--soft-hover); }
.file-pick-name { color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.progress { display: flex; flex-direction: column; gap: 6px; }
.progress[hidden] { display: none; }
.progress .bar { height: 8px; border-radius: 4px; background: var(--soft); overflow: hidden; }
.progress .bar i { display: block; height: 100%; width: 0; background: var(--save); transition: width 0.2s; }
.progress-text { font-size: 14px; color: var(--muted); }
.create-grid.busy .fields > :not(.progress):not(button) { opacity: 0.6; pointer-events: none; }
.guided.center { justify-content: center; flex-wrap: wrap; }

/* ---------------------------------------------------------------- settings */
.settings { max-width: 680px; margin: 0 auto; padding: 16px var(--pad) 64px; }
.settings > h1 { margin: 8px 0 20px; font-size: 32px; font-weight: 600; }
.card { margin-bottom: 16px; padding: 24px; border-radius: 24px; background: var(--card); box-shadow: var(--card-shadow); }
.card h2 { margin: 0; font-size: 20px; font-weight: 600; }
.card h3 { margin: 8px 0 0; font-size: 16px; font-weight: 600; }
.card > .muted { margin: -8px 0 0; }
.avatar-line { display: flex; align-items: center; gap: 14px; }
.login-row { display: flex; align-items: center; gap: 12px; min-height: 44px; }
.login-row .grow { flex: 1; }
.inline-form { display: flex; gap: 8px; }
.inline-form input { flex: 1; }
.danger-zone h2 { color: var(--save); }

/* ---------------------------------------------------------------- content factory */
.fx { padding-bottom: 48px; }
.fx-box {
	display: flex;
	gap: 14px;
	align-items: center;
	max-width: 760px;
	margin: 16px auto 0;
	padding: 12px;
	border-radius: 24px;
	background: var(--card);
	box-shadow: var(--card-shadow);
}
.fx-ref {
	flex: none;
	width: 56px;
	height: 84px;
	padding: 0;
	border: 0;
	border-radius: 12px;
	background: var(--soft);
	color: var(--muted);
	font-size: 22px;
	overflow: hidden;
	cursor: pointer;
}
.fx-ref:hover { background: var(--soft-hover); }
.fx-ref img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fx-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.fx-main textarea {
	width: 100%;
	border: 0;
	padding: 4px 2px;
	background: none;
	color: var(--text);
	font: inherit;
	font-size: 16px;
	line-height: 1.4;
	resize: none;
	outline: none;
}
.fx-opts { display: flex; flex-wrap: wrap; gap: 6px; }
.fx-opts select, .fx-chosen {
	height: 32px;
	padding: 0 12px;
	border: 0;
	border-radius: 16px;
	background: var(--soft);
	color: var(--text);
	font: inherit;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	appearance: none;
}
.fx-opts select:hover, .fx-chosen:hover { background: var(--soft-hover); }
.fx-go { flex: none; }
.fx-note { margin: 10px auto 0; max-width: 760px; text-align: center; color: var(--muted); font-size: 13px; }
.fx-note a { color: var(--text); font-weight: 600; }
.fx-title { margin: 36px 0 4px; padding: 0 var(--pad); text-align: center; font-size: 20px; font-weight: 600; }
.fx-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
	gap: var(--gap);
	padding: 12px var(--pad) 0;
}
.fx-card {
	position: relative;
	aspect-ratio: 9 / 16;
	border-radius: 16px;
	overflow: hidden;
	contain: content;
}
.fx-card.on { box-shadow: 0 0 0 3px var(--bg), 0 0 0 6px var(--text); }
.fx-media { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.fx-video { opacity: 0; transition: opacity 0.12s; }
.fx-card.playing .fx-video { opacity: 1; }
.fx-shade { position: absolute; inset: 0; background: linear-gradient(to top, rgba(0, 0, 0, 0.55), transparent 38%); pointer-events: none; }
.fx-use { position: absolute; top: 10px; right: 10px; height: 40px; opacity: 0; transition: opacity 0.12s; }
.fx-card:hover .fx-use, .fx-use:focus-visible, .fx-card.on .fx-use { opacity: 1; }
.fx-meta { position: absolute; left: 12px; right: 12px; bottom: 10px; color: #fff; pointer-events: none; }
.fx-meta b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.fx-meta span { display: inline-flex; align-items: center; gap: 4px; margin-top: 2px; font-size: 12px; font-weight: 600; opacity: 0.92; }
.fx-meta i { width: 6px; }
.fx-orig {
	position: absolute;
	right: 10px;
	bottom: 10px;
	width: 28px;
	height: 28px;
	display: grid;
	place-items: center;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.9);
	color: #111;
	font-size: 14px;
	font-weight: 700;
	text-decoration: none;
}
@media (hover: none) { .fx-use { opacity: 1; } }
@media (max-width: 640px) {
	.fx-box { flex-wrap: wrap; margin: 12px var(--pad) 0; }
	.fx-go { width: 100%; justify-content: center; }
	.fx-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
}
