Skip to content

Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.

59.5 KB
Raw Blame
/* ==========================================================================
   app-next — UX preview demo
   Surface goals:
   1. The avatar is the page. Stage, not chrome.
   2. One CTA hierarchy. No competing sign-in / save / upload mid-screen.
   3. Animation strip is an invitation, not a control panel.
   ========================================================================== */

:root {
	--nxt-bg-0:        #000000;
	--nxt-bg-1:        var(--surface-1,      var(--bg-0));
	--nxt-ink:         var(--ink,            var(--ink));
	--nxt-ink-dim:     var(--ink-dim,        #888888);
	--nxt-ink-fade:    var(--ink-dim,        #555555);
	--nxt-accent:      var(--accent,         #ffffff);
	--nxt-accent-soft: var(--accent-soft,    rgba(255, 255, 255, 0.10));
	/* Dark glass overlays — canonical surface system uses light glass;
	   dark glass here is a justified overlay for the chat dock context */
	--nxt-glass:       rgba(0, 0, 0, 0.55);
	--nxt-glass-strong:rgba(0, 0, 0, 0.82);
	--nxt-stroke:      var(--stroke,         rgba(255, 255, 255, 0.07));
	--nxt-stroke-strong:var(--stroke-strong, rgba(255, 255, 255, 0.13));
	--nxt-radius:      var(--radius-card,    14px);
	--nxt-radius-sm:   var(--radius-control, 10px);
	--nxt-radius-pill: var(--radius-pill,    999px);
	--nxt-header-h:    var(--header-h,       56px);

	/* Semantic tier — aliases to the canonical base tokens so every dashboard
	   surface renders status/panel colours consistently and stays theme-aware.
	   These were referenced across ~30 page modules (status pills, danger/kill
	   controls, raised panels, mono code) but had never been defined in this
	   namespace; usages inside color-mix()/rgba() with no inline fallback were
	   silently invalid until now. Each maps to a base token that already carries
	   light/dark overrides, with a hard fallback for safety. */
	--nxt-success:      var(--success,       #4ade80);
	--nxt-warn:         var(--warn,          #fbbf24);
	--nxt-danger:       var(--danger,        #f87171);
	--nxt-accent-strong:var(--accent-strong, var(--nxt-accent));
	--nxt-accent-rgb:   255, 255, 255;
	--nxt-ink-faint:    var(--ink-faint,     rgba(255, 255, 255, 0.45));
	--nxt-ink-soft:     var(--nxt-ink-dim);
	--nxt-bg:           var(--nxt-bg-1);
	--nxt-bg-2:         var(--surface-2,     rgba(255, 255, 255, 0.045));
	--nxt-bg-3:         var(--surface-3,     rgba(255, 255, 255, 0.07));
	--nxt-bg-base:      var(--nxt-bg-0);
	--nxt-bg-soft:      var(--nxt-bg-1);
	--nxt-panel:        var(--nxt-bg-2);
	--nxt-surface-2:    var(--surface-2,     rgba(255, 255, 255, 0.05));
	--nxt-line:         var(--line,          var(--nxt-stroke));
	--nxt-border:       var(--border,        var(--nxt-stroke));
	--nxt-mono:         var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
}

/* ── Body / shell ──────────────────────────────────────────────────────── */

html,
body {
	height: 100%;
}

body.app-next-body {
	margin: 0;
	background:
		/* Soft luminous lift behind the avatar */
		radial-gradient(ellipse 50% 35% at 50% 38%, rgba(255, 255, 255, 0.04) 0%, transparent 70%),
		/* Base depth gradient */
		radial-gradient(ellipse 90% 70% at 50% 60%, #0e0e0e 0%, #080808 55%, #020202 100%);
	color: var(--nxt-ink);
	font-family: var(--font-body);
	overflow: hidden;
}

/* Hide every chrome element produced by the production app.js that the
   demo overrides. None of these are required for the viewer to work.
   The auth gate and the "Your agent is ready" onboarding card used to be
   listed here AND shipped in this page's markup, so the page rendered two
   panels it then hid unconditionally: four links nobody could ever reach.
   The markup is gone; app.js only ever queried those ids, never created
   them, and every one of its lookups is null-guarded. */
body.app-next-body #agent-presence-sidebar,
body.app-next-body .dropzone,
body.app-next-body footer,
body.app-next-body .h-footer,
body.app-next-body .phi-grid,
body.app-next-body .phi-grid-label,
body.app-next-body .anim-panel,
body.app-next-body .agent-presence-sidebar,
body.app-next-body .save-toast,
body.app-next-body .controls-toggle,
body.app-next-body .gui-toggle,
body.app-next-body .gui-wrap,
body.app-next-body .ar-btn,
body.app-next-body .nich-toggle {
	display: none !important;
}

/* When NichAgent's panel is open (manually opened by overlay) restyle it to
   match the dock — same glass, same accent. Override its absolute positioning
   so it docks above the chat input rather than floating mid-screen. */
body.app-next-body .nich-panel {
	border-radius: 18px;
	border-color: rgba(255, 255, 255, 0.08);
	background: rgba(14, 15, 22, 0.92);
	backdrop-filter: blur(22px) saturate(140%);
	-webkit-backdrop-filter: blur(22px) saturate(140%);
	box-shadow: 0 28px 80px rgba(0, 0, 0, 0.6);
}

body.app-next-body.nxt-chat-open .nxt-chat-dock {
	z-index: 23;
}

/* Override style.css `body { display: flex }` since we manage layout ourselves */
body.app-next-body {
	display: block;
}

/* ── Header ────────────────────────────────────────────────────────────── */

.nxt-header {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	height: var(--nxt-header-h);
	padding: 0 18px 0 14px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	background: linear-gradient(180deg, rgba(5, 6, 8, 0.85) 0%, rgba(5, 6, 8, 0.55) 60%, rgba(5, 6, 8, 0) 100%);
	backdrop-filter: blur(14px) saturate(140%);
	-webkit-backdrop-filter: blur(14px) saturate(140%);
	z-index: 30;
	pointer-events: none; /* let clicks through to the canvas in dead space */
}

.nxt-header > * {
	pointer-events: auto;
}

.nxt-brand {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	text-decoration: none;
	color: var(--nxt-ink);
	font-weight: 600;
	letter-spacing: -0.01em;
	font-size: 15px;
	padding: 6px 10px 6px 6px;
	border-radius: var(--nxt-radius-pill);
	transition: background var(--duration-fast);
}

.nxt-brand:hover {
	background: rgba(255, 255, 255, 0.05);
}

.nxt-brand-mark {
	width: 24px;
	height: 24px;
	display: block;
}

.nxt-brand-tag {
	font-size: 10.5px;
	font-weight: 500;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--nxt-ink-dim);
	background: rgba(255, 255, 255, 0.06);
	padding: 3px 8px;
	border-radius: var(--nxt-radius-pill);
	margin-left: 4px;
}

.nxt-header-right {
	display: flex;
	align-items: center;
	gap: 8px;
	/* The header is a fixed bar with no overflow: whatever the auth cluster
	   renders (a handle, an email, a long display name) has to fit inside it,
	   or it runs past the right edge of a phone and takes the account menu with
	   it. Let the cluster shrink and truncate instead. */
	min-width: 0;
	flex: 0 1 auto;
}


.nxt-user-btn,
.nxt-signin {
	max-width: min(38vw, 220px);
	min-width: 0;
}

#nav-user-label {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	min-width: 0;
}

.nxt-more {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: transparent;
	border: 0;
	color: var(--nxt-ink-dim);
	font: inherit;
	font-size: 13.5px;
	padding: 7px 12px;
	border-radius: var(--nxt-radius-pill);
	cursor: pointer;
	transition: background var(--duration-fast), color var(--duration-fast);
}

.nxt-more:hover {
	color: var(--nxt-ink);
	background: rgba(255, 255, 255, 0.05);
}

.nxt-more svg {
	transition: transform var(--duration-fast);
}

.nxt-more[aria-expanded='true'] svg {
	transform: rotate(180deg);
}

.nxt-more-menu {
	position: fixed;
	top: var(--nxt-header-h);
	right: 12px;
	min-width: 200px;
	max-width: calc(100vw - 24px);
	padding: 6px;
	background: var(--nxt-glass-strong);
	border: 1px solid var(--nxt-stroke);
	border-radius: var(--nxt-radius);
	backdrop-filter: blur(20px);
	-webkit-backdrop-filter: blur(20px);
	box-shadow: 0 22px 60px rgba(0, 0, 0, 0.5);
	display: flex;
	flex-direction: column;
	gap: 2px;
	z-index: 40;
}

.nxt-more-menu[hidden] { display: none; }

.nxt-more-menu a,
.nxt-more-menu button {
	display: block;
	background: transparent;
	border: 0;
	color: var(--nxt-ink-dim);
	font: inherit;
	font-size: 13.5px;
	text-decoration: none;
	text-align: left;
	padding: 9px 12px;
	border-radius: 8px;
	cursor: pointer;
	transition: background var(--duration-fast), color var(--duration-fast);
}

.nxt-more-menu a:hover,
.nxt-more-menu button:hover {
	color: var(--nxt-ink);
	background: rgba(255, 255, 255, 0.05);
}

.nxt-more-sep {
	height: 1px;
	background: var(--nxt-stroke);
	margin: 4px 4px;
}

/* Auth surface */
.nxt-auth {
	position: relative;
}

.nxt-signin {
	display: inline-flex;
	align-items: center;
	background: rgba(255, 255, 255, 0.06);
	color: var(--nxt-ink);
	font-size: 13.5px;
	font-weight: 500;
	padding: 7px 14px;
	border-radius: var(--nxt-radius-pill);
	text-decoration: none;
	border: 1px solid var(--nxt-stroke);
	transition: background var(--duration-fast), border-color var(--duration-fast);
}

.nxt-signin:hover {
	background: rgba(255, 255, 255, 0.1);
	border-color: var(--nxt-stroke-strong);
}

.nxt-user-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	background: rgba(255, 255, 255, 0.06);
	color: var(--nxt-ink);
	border: 1px solid var(--nxt-stroke);
	font: inherit;
	font-size: 13.5px;
	font-weight: 500;
	padding: 6px 12px 6px 10px;
	border-radius: var(--nxt-radius-pill);
	cursor: pointer;
}

.nxt-user-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--nxt-ink);
	box-shadow: 0 0 6px rgba(255, 255, 255, 0.3);
}

.nxt-user-menu {
	position: absolute;
	top: calc(100% + 6px);
	right: 0;
	min-width: 200px;
	padding: 6px;
	background: var(--nxt-glass-strong);
	border: 1px solid var(--nxt-stroke);
	border-radius: var(--nxt-radius);
	backdrop-filter: blur(20px);
	-webkit-backdrop-filter: blur(20px);
	box-shadow: 0 22px 60px rgba(0, 0, 0, 0.5);
	z-index: 40;
}

.nxt-user-menu[hidden] { display: none; }

.nxt-user-menu a,
.nxt-user-menu button {
	display: block;
	background: transparent;
	border: 0;
	color: var(--nxt-ink-dim);
	font: inherit;
	font-size: 13.5px;
	text-align: left;
	padding: 9px 12px;
	border-radius: 8px;
	cursor: pointer;
	text-decoration: none;
	width: 100%;
}

.nxt-user-menu a:hover,
.nxt-user-menu button:hover {
	color: var(--nxt-ink);
	background: rgba(255, 255, 255, 0.05);
}

.nxt-user-sep {
	height: 1px;
	background: var(--nxt-stroke);
	margin: 4px 4px;
}

/* ── Stage / Main ──────────────────────────────────────────────────────── */

.nxt-main {
	position: fixed;
	inset: 0;
	width: 100vw;
	height: 100vh;
	min-height: 100vh;
	display: block;
}

.nxt-viewer {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	min-height: 0;
	/* Sit above the CSS stage layers so the avatar reads first, but allow the
	   floor glow to shine through the transparent canvas via blend-mode. */
	z-index: 4;
	background: transparent;
	pointer-events: auto;
	/* Shifts left into the empty stage when the chat thread docks on the right
	   (see --nxt-stage-shift). 0 by default so the avatar stays centered. */
	transform: translateX(var(--nxt-stage-shift, 0));
	transition: transform var(--duration-slow) var(--ease-standard);
}

.nxt-viewer canvas {
	display: block;
	width: 100% !important;
	height: 100% !important;
}

/* Floor glow: a layered pool of light under the avatar's feet, painted
   BEHIND the transparent canvas. The overlay JS flips viewer.state.transparentBg
   so non-avatar pixels reveal these layers. */
.nxt-stage-floor {
	position: absolute;
	left: 50%;
	bottom: 8%;
	width: 88vmin;
	height: 32vmin;
	/* Tracks the avatar's --nxt-stage-shift so the glow stays under the feet. */
	transform: translate(calc(-50% + var(--nxt-stage-shift, 0)), 18%);
	transition: transform var(--duration-slow) var(--ease-standard);
	background:
		/* Inner soft light pool */
		radial-gradient(
			ellipse 40% 35% at center,
			rgba(255, 255, 255, 0.22) 0%,
			rgba(255, 255, 255, 0.06) 35%,
			rgba(0, 0, 0, 0) 70%
		),
		/* Outer ambient halo */
		radial-gradient(
			ellipse 90% 70% at center,
			rgba(255, 255, 255, 0.04) 0%,
			rgba(0, 0, 0, 0) 65%
		);
	pointer-events: none;
	z-index: 2;
	filter: blur(3px);
}

/* Thin ring directly under the avatar — a subtle "agent base" hint */
.nxt-stage-floor::after {
	content: '';
	position: absolute;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -45%);
	width: 32vmin;
	height: 32vmin;
	border-radius: 50%;
	background: radial-gradient(
		circle at center,
		rgba(255, 255, 255, 0.0) 30%,
		rgba(255, 255, 255, 0.12) 55%,
		rgba(255, 255, 255, 0.0) 70%
	);
	filter: blur(0.5px);
	opacity: 0.7;
}

/* Vignette — pulls the eye inward, fades to deep black at the edges */
.nxt-stage-vignette {
	position: absolute;
	inset: 0;
	pointer-events: none;
	z-index: 3;
	background:
		radial-gradient(
			ellipse 70% 80% at center,
			transparent 30%,
			rgba(0, 0, 0, 0.55) 78%,
			rgba(0, 0, 0, 0.85) 100%
		);
}

/* ── Action bar ────────────────────────────────────────────────────────── */

.nxt-action-bar {
	position: fixed;
	left: 50%;
	bottom: 24px;
	transform: translateX(-50%);
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px;
	background: var(--nxt-glass-strong);
	border: 1px solid var(--nxt-stroke);
	border-radius: var(--nxt-radius-pill);
	backdrop-filter: blur(16px) saturate(140%);
	-webkit-backdrop-filter: blur(16px) saturate(140%);
	box-shadow: 0 28px 64px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.02) inset;
	z-index: 21;
	animation: nxt-rise-bar 0.5s 0.2s both;
}

@keyframes nxt-rise-bar {
	from { opacity: 0; transform: translate(-50%, 14px); }
	to { opacity: 1; transform: translate(-50%, 0); }
}

.nxt-action {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	background: transparent;
	color: var(--nxt-ink-dim);
	border: 0;
	font: inherit;
	font-size: 13.5px;
	font-weight: 500;
	padding: 9px 14px;
	border-radius: var(--nxt-radius-pill);
	cursor: pointer;
	white-space: nowrap;
	transition: background var(--duration-fast), color var(--duration-fast), transform var(--duration-fast);
}

.nxt-action svg { flex: none; }

.nxt-action kbd {
	font: 10.5px 'SF Mono', ui-monospace, monospace;
	color: var(--nxt-ink-fade);
	background: rgba(255, 255, 255, 0.06);
	padding: 2px 6px;
	border-radius: 5px;
	border: 1px solid var(--nxt-stroke);
	letter-spacing: 0.04em;
	margin-left: 2px;
}

.nxt-action--ghost:hover {
	color: var(--nxt-ink);
	background: rgba(255, 255, 255, 0.06);
}

/* Attribution, not an action: smaller and dimmer than Restyle/AR/Download so
   it reads as a credit, not another button to press. */
.nxt-action--credit {
	font-size: 11.5px;
	opacity: 0.72;
	padding: 9px 10px;
}

.nxt-action--credit:hover {
	opacity: 1;
}

.nxt-action:focus-visible {
	outline: var(--focus-ring-width, 2px) solid var(--focus-ring-color, #6c8cff);
	outline-offset: 2px;
}

.nxt-action--primary {
	background: var(--nxt-ink);
	color: var(--bg-0);
	box-shadow: 0 6px 18px rgba(255, 255, 255, 0.12);
}

.nxt-action--primary:hover {
	transform: translateY(-1px);
	box-shadow: 0 10px 22px rgba(255, 255, 255, 0.18);
}

.nxt-action--primary kbd {
	background: rgba(255, 255, 255, 0.18);
	color: rgba(255, 255, 255, 0.85);
	border-color: rgba(255, 255, 255, 0.25);
}

/* ── Deploy on-chain action ────────────────────────────────────────────── */
.nxt-action--deploy {
	text-decoration: none;
	color: var(--nxt-ink);
	background: rgba(255, 255, 255, 0.06);
	border: 1px solid rgba(255, 255, 255, 0.14);
	box-shadow: 0 0 0 0 transparent;
	position: relative;
}

.nxt-action--deploy:hover {
	background: rgba(255, 255, 255, 0.10);
	border-color: rgba(255, 255, 255, 0.22);
	transform: translateY(-1px);
	box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.nxt-action--deploy::before {
	content: '';
	position: absolute;
	top: 50%;
	left: 14px;
	width: 6px;
	height: 6px;
	border-radius: 999px;
	background: var(--nxt-ink-dim);
	box-shadow: 0 0 6px rgba(255, 255, 255, 0.3);
	transform: translateY(-50%);
	opacity: 0;
	pointer-events: none;
}

.nxt-action--deploy.is-deployed {
	color: var(--nxt-ink);
	background: rgba(255, 255, 255, 0.08);
	border-color: rgba(255, 255, 255, 0.20);
}

.nxt-action--deploy.is-deployed:hover {
	background: rgba(255, 255, 255, 0.12);
	border-color: rgba(255, 255, 255, 0.28);
	box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.nxt-action--deploy.is-deployed::before {
	background: var(--nxt-ink);
	box-shadow: 0 0 6px rgba(255, 255, 255, 0.4);
}

.nxt-hidden-hosts { display: none !important; }

/* ── Scene backdrop (switchable) ───────────────────────────────────────────
   Bottommost stage layer behind the transparent avatar canvas. Painted by
   app-next-overlay.js from a saved preset, the Backdrop picker, or agent chat
   (setBgColor → nxt:backdrop). Sits below the floor glow + vignette so those
   keep reading on top of whatever scene is chosen. */
.nxt-stage-backdrop {
	position: absolute;
	inset: 0;
	z-index: 1;
	pointer-events: none;
	background: radial-gradient(circle at 50% 28%, #2c2c2c 0%, #111111 72%);
	transition: background var(--duration-slow) var(--ease-standard);
}

/* ── Avatar switch button (loading state) ──────────────────────────────── */
.nxt-action.is-loading {
	opacity: 0.6;
	pointer-events: none;
}

/* ── Backdrop picker ───────────────────────────────────────────────────── */
.nxt-backdrop-wrap {
	position: relative;
	display: inline-flex;
}

.nxt-backdrop-popover {
	position: absolute;
	bottom: calc(100% + 10px);
	left: 50%;
	transform: translateX(-50%);
	width: 248px;
	padding: 12px;
	background: var(--nxt-glass-strong);
	border: 1px solid var(--nxt-stroke);
	border-radius: var(--nxt-radius);
	backdrop-filter: blur(20px) saturate(140%);
	-webkit-backdrop-filter: blur(20px) saturate(140%);
	box-shadow: 0 24px 54px rgba(0, 0, 0, 0.6);
	z-index: 36;
	animation: nxt-backdrop-in 0.16s ease-out both;
}

.nxt-backdrop-popover[hidden] { display: none; }

@keyframes nxt-backdrop-in {
	from { opacity: 0; transform: translate(-50%, 6px); }
	to { opacity: 1; transform: translate(-50%, 0); }
}

.nxt-backdrop-popover__head {
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--nxt-ink-fade);
	margin: 0 2px 10px;
}

.nxt-backdrop-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 8px;
}

.nxt-backdrop-swatch {
	position: relative;
	aspect-ratio: 1 / 1;
	border: 1px solid var(--nxt-stroke);
	border-radius: var(--nxt-radius-sm);
	cursor: pointer;
	padding: 0;
	overflow: hidden;
	transition: transform var(--duration-fast) var(--ease-standard), box-shadow var(--duration-fast) var(--ease-standard), border-color var(--duration-fast) var(--ease-standard);
}

.nxt-backdrop-swatch:hover {
	transform: translateY(-1px);
	border-color: rgba(255, 255, 255, 0.28);
	box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.nxt-backdrop-swatch.is-active {
	border-color: var(--nxt-ink);
	box-shadow: 0 0 0 2px var(--nxt-ink) inset;
}

.nxt-backdrop-swatch__label {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	padding: 3px 5px;
	font-size: 10px;
	font-weight: 600;
	letter-spacing: 0.02em;
	color: #fff;
	background: linear-gradient(to top, rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0));
	text-align: left;
}

.nxt-backdrop-swatch.is-light .nxt-backdrop-swatch__label {
	color: var(--on-bright);
	background: linear-gradient(to top, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0));
}

.nxt-backdrop-swatch:focus-visible {
	outline: 2px solid var(--nxt-ink);
	outline-offset: 2px;
}

/* ── Animation picker sheet ────────────────────────────────────────────── */

.nxt-anim-sheet {
	position: fixed;
	left: 50%;
	bottom: 92px;
	transform: translateX(-50%);
	width: min(720px, calc(100vw - 32px));
	max-height: 60vh;
	display: flex;
	flex-direction: column;
	background: var(--nxt-glass-strong);
	border: 1px solid var(--nxt-stroke);
	border-radius: 18px;
	backdrop-filter: blur(22px) saturate(140%);
	-webkit-backdrop-filter: blur(22px) saturate(140%);
	box-shadow: 0 28px 80px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.02) inset;
	z-index: 25;
	overflow: hidden;
	animation: nxt-sheet-up 0.22s ease-out both;
}

.nxt-anim-sheet[hidden] { display: none; }

@keyframes nxt-sheet-up {
	from { opacity: 0; transform: translate(-50%, 10px); }
	to { opacity: 1; transform: translate(-50%, 0); }
}

.nxt-anim-sheet__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px 18px 8px;
}

.nxt-anim-sheet__head h2 {
	margin: 0;
	font-size: 14px;
	font-weight: 600;
	color: var(--nxt-ink);
	letter-spacing: 0.02em;
}

.nxt-anim-sheet__close {
	background: transparent;
	border: 0;
	color: var(--nxt-ink-fade);
	font-size: 22px;
	line-height: 1;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	cursor: pointer;
	transition: background var(--duration-fast), color var(--duration-fast);
}

.nxt-anim-sheet__close:hover {
	color: var(--nxt-ink);
	background: rgba(255, 255, 255, 0.06);
}

.nxt-anim-sheet__filter {
	padding: 0 18px 12px;
}

.nxt-anim-search {
	width: 100%;
	background: rgba(255, 255, 255, 0.05);
	border: 1px solid var(--nxt-stroke);
	border-radius: 10px;
	color: var(--nxt-ink);
	font: inherit;
	font-size: 13.5px;
	padding: 9px 12px;
	outline: none;
	transition: border-color var(--duration-fast), background var(--duration-fast);
}

.nxt-anim-search:focus {
	border-color: rgba(255, 255, 255, 0.45);
	background: rgba(255, 255, 255, 0.08);
	box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.22);
}

.nxt-anim-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
	gap: 6px;
	padding: 0 12px 14px;
	overflow-y: auto;
	scrollbar-width: thin;
	scrollbar-color: rgba(255, 255, 255, 0.12) transparent;
}

.nxt-anim-grid::-webkit-scrollbar {
	width: 8px;
}
.nxt-anim-grid::-webkit-scrollbar-thumb {
	background: rgba(255, 255, 255, 0.12);
	border-radius: 4px;
}

.nxt-anim-card {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 6px;
	padding: 12px 8px 10px;
	background: rgba(255, 255, 255, 0.03);
	border: 1px solid rgba(255, 255, 255, 0.05);
	border-radius: 10px;
	color: var(--nxt-ink);
	cursor: pointer;
	font: inherit;
	font-size: 11.5px;
	text-align: center;
	line-height: 1.3;
	transition: background var(--duration-fast), border-color var(--duration-fast), transform var(--duration-fast);
}

.nxt-anim-card:hover {
	background: rgba(255, 255, 255, 0.07);
	border-color: rgba(255, 255, 255, 0.12);
	transform: translateY(-1px);
}

.nxt-anim-card[aria-pressed='true'] {
	background: rgba(255, 255, 255, 0.10);
	border-color: rgba(255, 255, 255, 0.22);
	color: var(--nxt-ink);
}

.nxt-anim-card__icon {
	font-size: 22px;
	line-height: 1;
}

.nxt-anim-empty {
	grid-column: 1 / -1;
	text-align: center;
	color: var(--nxt-ink-fade);
	padding: 28px 12px;
	font-size: 13px;
}

/* ── Drag-over overlay ─────────────────────────────────────────────────── */

body.app-next-body.is-dragover::before {
	content: 'Drop to load model';
	position: fixed;
	inset: 16px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 16px;
	font-weight: 600;
	letter-spacing: 0.02em;
	color: var(--nxt-ink);
	background: rgba(255, 255, 255, 0.03);
	border: 2px dashed rgba(255, 255, 255, 0.25);
	border-radius: 16px;
	z-index: 50;
	pointer-events: none;
}

/* ── First-visit hint ──────────────────────────────────────────────────── */

.nxt-first-hint {
	position: fixed;
	top: calc(var(--nxt-header-h) + 14px);
	left: 50%;
	transform: translateX(-50%);
	display: inline-flex;
	align-items: center;
	gap: 12px;
	padding: 8px 8px 8px 14px;
	background: var(--nxt-glass-strong);
	border: 1px solid var(--nxt-stroke);
	border-radius: var(--nxt-radius-pill);
	backdrop-filter: blur(14px);
	-webkit-backdrop-filter: blur(14px);
	font-size: 12.5px;
	color: var(--nxt-ink-dim);
	z-index: 22;
	animation: nxt-rise 0.5s 0.8s both;
}

.nxt-first-hint[hidden] { display: none; }

.nxt-first-hint button {
	background: transparent;
	border: 0;
	color: var(--nxt-ink-fade);
	width: 22px;
	height: 22px;
	border-radius: 50%;
	cursor: pointer;
	font-size: 18px;
	line-height: 1;
}

.nxt-first-hint button:hover {
	color: var(--nxt-ink);
	background: rgba(255, 255, 255, 0.06);
}

/* ── Spinner ───────────────────────────────────────────────────────────── */

.spinner {
	position: fixed;
	top: 50%;
	left: 50%;
	width: 36px;
	height: 36px;
	margin: -18px 0 0 -18px;
	border-radius: 50%;
	border: 2.5px solid rgba(255, 255, 255, 0.08);
	border-top-color: var(--nxt-ink);
	animation: nxt-spin 0.8s linear infinite;
	z-index: 5;
	pointer-events: none;
}

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

/* ── Camera presets ────────────────────────────────────────────────────── */

.nxt-preset-cluster {
	display: inline-flex;
	align-items: center;
	gap: 2px;
	padding: 3px;
	background: rgba(14, 15, 22, 0.5);
	border: 1px solid var(--nxt-stroke);
	border-radius: var(--nxt-radius-pill);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
}

.nxt-preset {
	background: transparent;
	border: 0;
	color: var(--nxt-ink-fade);
	font: inherit;
	font-size: 12px;
	font-weight: 500;
	padding: 5px 11px;
	border-radius: var(--nxt-radius-pill);
	cursor: pointer;
	transition: color var(--duration-fast), background var(--duration-fast);
}

.nxt-preset:hover {
	color: var(--nxt-ink);
}

.nxt-preset.is-active {
	color: var(--nxt-ink);
	background: rgba(255, 255, 255, 0.08);
}

/* ── Icon buttons (fullscreen, share) ──────────────────────────────────── */

.nxt-icon-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	background: rgba(14, 15, 22, 0.5);
	border: 1px solid var(--nxt-stroke);
	border-radius: 50%;
	color: var(--nxt-ink-dim);
	cursor: pointer;
	transition: color var(--duration-fast), background var(--duration-fast), border-color var(--duration-fast);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
}

.nxt-icon-btn:hover {
	color: var(--nxt-ink);
	background: rgba(255, 255, 255, 0.06);
	border-color: var(--nxt-stroke-strong);
}

/* ── Chat dock ─────────────────────────────────────────────────────────── */

.nxt-chat-dock {
	position: fixed;
	left: 50%;
	bottom: 76px;
	transform: translateX(-50%);
	width: min(640px, calc(100vw - 32px));
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 8px;
	z-index: 21;
	animation: nxt-rise-bar 0.5s 0.2s both;
}

.nxt-chat-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	justify-content: center;
}

.nxt-chat-chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: rgba(14, 15, 22, 0.7);
	border: 1px solid var(--nxt-stroke);
	color: var(--nxt-ink-dim);
	font: inherit;
	font-size: 12.5px;
	padding: 6px 12px;
	border-radius: var(--nxt-radius-pill);
	cursor: pointer;
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	transition: color var(--duration-fast), background var(--duration-fast), border-color var(--duration-fast), transform var(--duration-fast);
}

.nxt-chat-chip:hover {
	color: var(--nxt-ink);
	border-color: rgba(255, 255, 255, 0.16);
	background: rgba(255, 255, 255, 0.06);
	transform: translateY(-1px);
}

.nxt-chat-chip__icon {
	font-size: 14px;
	line-height: 1;
}

.nxt-chat-input-wrap {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 6px 6px 6px 14px;
	background: var(--nxt-glass-strong);
	border: 1px solid var(--nxt-stroke);
	border-radius: 14px;
	backdrop-filter: blur(20px) saturate(140%);
	-webkit-backdrop-filter: blur(20px) saturate(140%);
	box-shadow: 0 28px 64px rgba(0, 0, 0, 0.55);
	transition: border-color var(--duration-fast), box-shadow var(--duration-fast);
}

/* The input itself carries `outline: none`, so the wrap is the only thing that
   can show focus. A 6%-alpha ring was effectively invisible on the dark glass:
   keyboard users had no way to tell the field was focused. */
.nxt-chat-input-wrap:focus-within {
	border-color: rgba(255, 255, 255, 0.45);
	box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.28), 0 28px 64px rgba(0, 0, 0, 0.55);
}

.nxt-chat-input-icon {
	flex: none;
	color: var(--nxt-ink-fade);
}

.nxt-chat-input {
	flex: 1;
	min-width: 0;
	background: transparent;
	border: 0;
	color: var(--nxt-ink);
	font: inherit;
	font-size: 14px;
	padding: 8px 4px;
	outline: none;
}

.nxt-chat-input::placeholder {
	color: var(--nxt-ink-fade);
}

.nxt-chat-mic,
.nxt-chat-send {
	flex: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border: 0;
	border-radius: 50%;
	cursor: pointer;
	transition: background var(--duration-fast), color var(--duration-fast), transform var(--duration-fast);
}

.nxt-chat-mic {
	background: rgba(255, 255, 255, 0.05);
	color: var(--nxt-ink-dim);
}

.nxt-chat-mic:hover,
.nxt-chat-mic.is-active {
	color: var(--nxt-ink);
	background: rgba(255, 255, 255, 0.1);
}

.nxt-chat-mic.is-recording {
	background: var(--nxt-ink);
	color: var(--bg-0);
	animation: nxt-mic-pulse 1.2s ease-in-out infinite;
}

@keyframes nxt-mic-pulse {
	0%, 100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.3); }
	50% { box-shadow: 0 0 0 8px rgba(255, 255, 255, 0); }
}

.nxt-chat-send {
	background: var(--nxt-ink);
	color: var(--bg-0);
	box-shadow: 0 4px 12px rgba(255, 255, 255, 0.10);
}

.nxt-chat-send:hover {
	transform: translateY(-1px);
	box-shadow: 0 6px 16px rgba(255, 255, 255, 0.16);
}

.nxt-chat-send:disabled,
.nxt-chat-mic:disabled {
	opacity: 0.4;
	cursor: not-allowed;
	transform: none;
}

/* ── Secondary action bar — smaller, below the chat dock ───────────────── */

.nxt-action-bar--secondary {
	bottom: 18px;
	padding: 4px;
	box-shadow: 0 16px 36px rgba(0, 0, 0, 0.4);
}

.nxt-action-bar--secondary .nxt-action {
	padding: 7px 12px;
	font-size: 12.5px;
}

/* ── Agent reply bubble (above the avatar) ─────────────────────────────── */

.nxt-agent-bubble {
	position: fixed;
	left: 50%;
	top: 18%;
	transform: translateX(-50%);
	max-width: min(540px, calc(100vw - 40px));
	z-index: 19;
	animation: nxt-bubble-in 0.32s ease-out both;
}

.nxt-agent-bubble[hidden] { display: none; }

@keyframes nxt-bubble-in {
	from { opacity: 0; transform: translate(-50%, -8px); }
	to { opacity: 1; transform: translate(-50%, 0); }
}

.nxt-agent-bubble__inner {
	display: inline-flex;
	align-items: flex-start;
	gap: 10px;
	padding: 12px 18px;
	background: var(--nxt-glass-strong);
	border: 1px solid rgba(255, 255, 255, 0.10);
	border-radius: 18px;
	backdrop-filter: blur(20px);
	-webkit-backdrop-filter: blur(20px);
	box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.nxt-agent-bubble__dot {
	flex: none;
	width: 8px;
	height: 8px;
	margin-top: 6px;
	border-radius: 50%;
	background: var(--nxt-ink);
	box-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
}

.nxt-agent-bubble__text {
	font-size: 14px;
	line-height: 1.45;
	color: var(--nxt-ink);
}

/* ── Share popover ────────────────────────────────────────────────────── */

.nxt-share-popover {
	position: fixed;
	top: calc(var(--nxt-header-h) + 12px);
	right: 18px;
	width: min(380px, calc(100vw - 32px));
	background: var(--nxt-glass-strong);
	border: 1px solid var(--nxt-stroke);
	border-radius: 16px;
	backdrop-filter: blur(20px) saturate(140%);
	-webkit-backdrop-filter: blur(20px) saturate(140%);
	box-shadow: 0 28px 60px rgba(0, 0, 0, 0.6);
	z-index: 35;
	overflow: hidden;
	animation: nxt-share-in 0.18s ease-out both;
}

.nxt-share-popover[hidden] { display: none; }

@keyframes nxt-share-in {
	from { opacity: 0; transform: translateY(-6px); }
	to { opacity: 1; transform: translateY(0); }
}

.nxt-share-popover__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 16px 6px;
}

.nxt-share-popover__head h2 {
	margin: 0;
	font-size: 13.5px;
	font-weight: 600;
	color: var(--nxt-ink);
}

.nxt-share-close {
	background: transparent;
	border: 0;
	color: var(--nxt-ink-fade);
	font-size: 20px;
	line-height: 1;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	cursor: pointer;
}

.nxt-share-close:hover {
	color: var(--nxt-ink);
	background: rgba(255, 255, 255, 0.06);
}

.nxt-share-popover__body {
	padding: 6px 16px 14px;
}

.nxt-share-row {
	display: block;
	margin-bottom: 12px;
}

.nxt-share-label {
	display: block;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--nxt-ink-fade);
	margin-bottom: 6px;
}

.nxt-share-copy {
	display: flex;
	gap: 6px;
}

.nxt-share-copy--block {
	flex-direction: column;
}

.nxt-share-copy input,
.nxt-share-copy textarea {
	flex: 1;
	min-width: 0;
	background: rgba(255, 255, 255, 0.04);
	border: 1px solid var(--nxt-stroke);
	border-radius: 8px;
	color: var(--nxt-ink);
	font: 12px 'SF Mono', ui-monospace, monospace;
	padding: 8px 10px;
	outline: none;
	resize: vertical;
}

.nxt-share-copy input:focus,
.nxt-share-copy textarea:focus {
	border-color: rgba(255, 255, 255, 0.45);
	box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.22);
}

.nxt-share-copy button {
	flex: none;
	background: var(--nxt-ink);
	color: var(--bg-0);
	border: 0;
	border-radius: 8px;
	padding: 8px 14px;
	font: inherit;
	font-size: 12.5px;
	font-weight: 500;
	cursor: pointer;
	transition: transform var(--duration-fast), box-shadow var(--duration-fast);
}

.nxt-share-copy--block button {
	align-self: flex-end;
	padding: 6px 14px;
	margin-top: 6px;
}

.nxt-share-copy button:hover {
	transform: translateY(-1px);
	box-shadow: 0 4px 10px rgba(255, 255, 255, 0.12);
}

.nxt-share-copy button.is-copied {
	background: rgba(255, 255, 255, 0.18);
	color: var(--nxt-ink);
}

.nxt-share-hint {
	margin: 4px 0 0;
	font-size: 11.5px;
	color: var(--nxt-ink-fade);
	line-height: 1.5;
}

/* ── Share popover: Deploy on-chain row ────────────────────────────────── */
.nxt-share-divider {
	height: 1px;
	background: var(--nxt-stroke);
	margin: 14px -16px 12px;
}

.nxt-share-deploy {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 12px;
	margin: 0 -4px;
	border-radius: 12px;
	text-decoration: none;
	color: var(--nxt-ink);
	background: rgba(255, 255, 255, 0.04);
	border: 1px solid rgba(255, 255, 255, 0.10);
	transition: background var(--duration-fast), border-color var(--duration-fast), transform var(--duration-fast);
}

.nxt-share-deploy:hover {
	background: rgba(255, 255, 255, 0.08);
	border-color: rgba(255, 255, 255, 0.18);
}

.nxt-share-deploy__icon {
	flex: none;
	width: 32px;
	height: 32px;
	display: grid;
	place-items: center;
	border-radius: 9px;
	background: rgba(255, 255, 255, 0.08);
	color: var(--nxt-ink-dim);
}

.nxt-share-deploy.is-deployed .nxt-share-deploy__icon {
	background: rgba(255, 255, 255, 0.12);
	color: var(--nxt-ink);
}

.nxt-share-deploy.is-deployed {
	background: rgba(255, 255, 255, 0.06);
	border-color: rgba(255, 255, 255, 0.14);
}

.nxt-share-deploy.is-deployed:hover {
	background: rgba(255, 255, 255, 0.10);
	border-color: rgba(255, 255, 255, 0.22);
}

.nxt-share-deploy__copy {
	display: flex;
	flex-direction: column;
	gap: 2px;
	flex: 1;
	min-width: 0;
}

.nxt-share-deploy__title {
	font-size: 13px;
	font-weight: 600;
	color: var(--nxt-ink);
	letter-spacing: 0.005em;
}

.nxt-share-deploy__sub {
	font-size: 11.5px;
	color: var(--nxt-ink-fade);
	line-height: 1.4;
}

.nxt-share-deploy__chev {
	flex: none;
	color: var(--nxt-ink-fade);
}

/* ── Keyboard help ─────────────────────────────────────────────────────── */

.nxt-help {
	position: fixed;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: min(420px, calc(100vw - 32px));
	background: var(--nxt-glass-strong);
	border: 1px solid var(--nxt-stroke);
	border-radius: 16px;
	backdrop-filter: blur(22px) saturate(140%);
	-webkit-backdrop-filter: blur(22px) saturate(140%);
	box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7);
	z-index: 60;
	padding: 18px 18px 14px;
	animation: nxt-help-in 0.18s ease-out both;
}

.nxt-help[hidden] { display: none; }

@keyframes nxt-help-in {
	from { opacity: 0; transform: translate(-50%, -46%); }
	to { opacity: 1; transform: translate(-50%, -50%); }
}

.nxt-help__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 12px;
}

.nxt-help__head h2 {
	margin: 0;
	font-size: 14px;
	font-weight: 600;
}

.nxt-help__close {
	background: transparent;
	border: 0;
	color: var(--nxt-ink-fade);
	font-size: 20px;
	line-height: 1;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	cursor: pointer;
}

.nxt-help__close:hover {
	color: var(--nxt-ink);
	background: rgba(255, 255, 255, 0.06);
}

.nxt-help__grid {
	display: grid;
	grid-template-columns: 100px 1fr;
	gap: 8px 12px;
	margin: 0;
}

.nxt-help__grid dt {
	margin: 0;
	display: flex;
	align-items: center;
	gap: 4px;
	color: var(--nxt-ink-dim);
}

.nxt-help__grid dt kbd {
	font: 11px 'SF Mono', ui-monospace, monospace;
	background: rgba(255, 255, 255, 0.06);
	border: 1px solid var(--nxt-stroke);
	border-radius: 5px;
	padding: 2px 6px;
	color: var(--nxt-ink);
}

.nxt-help__grid dd {
	margin: 0;
	font-size: 12.5px;
	color: var(--nxt-ink);
	align-self: center;
}

/* ── Toast ─────────────────────────────────────────────────────────────── */

.nxt-toast {
	position: fixed;
	top: calc(var(--nxt-header-h) + 12px);
	left: 50%;
	transform: translateX(-50%);
	max-width: calc(100vw - 32px);
	padding: 9px 14px;
	background: var(--nxt-glass-strong);
	border: 1px solid var(--nxt-stroke);
	border-radius: var(--nxt-radius-pill);
	backdrop-filter: blur(14px);
	-webkit-backdrop-filter: blur(14px);
	color: var(--nxt-ink);
	font-size: 13px;
	z-index: 70;
	animation: nxt-toast-in 0.22s ease-out both;
}

.nxt-toast[hidden] { display: none; }

.nxt-toast a {
	color: var(--nxt-accent);
	margin-left: 6px;
	text-decoration: none;
	font-weight: 500;
}

.nxt-toast a:hover { text-decoration: underline; }

@keyframes nxt-toast-in {
	from { opacity: 0; transform: translate(-50%, -6px); }
	to { opacity: 1; transform: translate(-50%, 0); }
}

/* ── Chat-embed mode (/a/<uuid>?embed=1) ───────────────────────────────── */
/* Hide all site chrome; only the 3D canvas + NichAgent panel remain.      */

body[data-viewer-mode='embed'].app-next-body .nxt-header,
body[data-viewer-mode='embed'].app-next-body .nxt-action-bar,
body[data-viewer-mode='embed'].app-next-body .nxt-first-hint,
body[data-viewer-mode='embed'].app-next-body .nxt-more-btn,
body[data-viewer-mode='embed'].app-next-body .nxt-preset-cluster {
	display: none !important;
}

/* ── Auto-hide chrome ──────────────────────────────────────────────────── */

body.app-next-body.nxt-chrome-hidden .nxt-header,
body.app-next-body.nxt-chrome-hidden .nxt-action-bar,
body.app-next-body.nxt-chrome-hidden .nxt-chat-dock,
body.app-next-body.nxt-chrome-hidden .nxt-first-hint {
	opacity: 0;
	pointer-events: none;
	transform: translateY(8px);
}

.nxt-header,
.nxt-action-bar,
.nxt-chat-dock,
.nxt-first-hint {
	transition: opacity var(--duration-slow) var(--ease-standard), transform var(--duration-slow) var(--ease-standard);
}

/* When the chat input is focused or NichAgent panel is open, force chrome to stay visible. */
body.app-next-body.nxt-chat-active .nxt-header,
body.app-next-body.nxt-chat-active .nxt-action-bar,
body.app-next-body.nxt-chat-active .nxt-chat-dock {
	opacity: 1;
	pointer-events: auto;
	transform: none;
}

/* The chat dock's chip row is translated with the dock; keep their transforms in sync */
.nxt-chat-dock .nxt-chat-chips {
	transition: opacity var(--duration-base) var(--ease-standard);
}

body.app-next-body.nxt-chrome-hidden .nxt-chat-dock .nxt-chat-chips {
	opacity: 0;
}

/* ── NichAgent panel positioning override ─────────────────────────────── */

/* Dock the chat panel to the right so the avatar stays visible. The panel
   sits directly above the chat dock, which also slides right when active. */
body.app-next-body .nich-panel {
	position: fixed;
	right: 16px;
	bottom: 168px;
	left: auto;
	top: auto;
	transform: none;
	width: min(380px, calc(100vw - 32px));
	max-height: min(50vh, 480px);
	z-index: 24;
}

/* The chat dock is the single composer on /app-next — it writes through to the
   panel's hidden .nich-input and clicks .nich-mic programmatically. Hide the
   panel's own input + mic row so we don't render two stacked composers; the
   panel stays a pure conversation thread (header + messages). */
body.app-next-body .nich-panel .nich-controls,
body.app-next-body .nich-panel .nich-mic-row {
	display: none !important;
}

/* When chat is active, slide the input dock to the right to align with the
   conversation panel — keeps input + thread as one unified column.
   Uses translate instead of left/right so the transition animates cleanly. */
body.app-next-body.nxt-chat-active .nxt-chat-dock {
	left: auto;
	right: 16px;
	/* The entrance animation uses fill-mode `both`, which otherwise pins the
	   dock's transform to translateX(-50%) and defeats this right-alignment.
	   The rise has long since played by the time chat is active, so drop it. */
	animation: none;
	transform: none;
	width: min(380px, calc(100vw - 32px));
}

/* ── Unified chat card ─────────────────────────────────────────────────────
   While the thread is open, the panel (above) and dock (below) are fused into
   one glass card so they read as a single chat — not two stacked widgets. JS
   pins the panel's bottom edge flush onto the dock's top edge; the rules below
   square the seam, continue the glass down through the composer, and quiet the
   input pill into an inset row of the same card. */
body.app-next-body.nxt-chat-merged .nich-panel {
	border-bottom-left-radius: 0;
	border-bottom-right-radius: 0;
	/* Faint divider between thread and composer; drop the downward shadow so the
	   card looks continuous instead of like a box hovering over another box. */
	border-bottom-color: rgba(255, 255, 255, 0.06);
	box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.5);
}

body.app-next-body.nxt-chat-merged .nxt-chat-dock {
	gap: 0;
	padding: 10px 12px 12px;
	background: rgba(14, 15, 22, 0.92);
	backdrop-filter: blur(22px) saturate(140%);
	-webkit-backdrop-filter: blur(22px) saturate(140%);
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-top: none; /* the panel's border-bottom is the only seam line */
	border-bottom-left-radius: 18px;
	border-bottom-right-radius: 18px;
	box-shadow: 0 28px 80px rgba(0, 0, 0, 0.6);
}

body.app-next-body.nxt-chat-merged .nxt-chat-chips {
	justify-content: flex-start;
	padding: 2px 2px 10px;
}

/* While the conversation thread is open it docks against the right edge and
   would otherwise cover the centered avatar. Nudge the whole stage left into the
   empty half so the avatar reads clear of the panel. Desktop only — below 720px
   the panel centers and there's no room to shift. */
@media (min-width: 721px) {
	body.app-next-body.nxt-chat-merged {
		--nxt-stage-shift: -190px;
	}
}

/* Inside the card the composer is just a row — strip its standalone pill chrome. */
body.app-next-body.nxt-chat-merged .nxt-chat-input-wrap {
	background: rgba(255, 255, 255, 0.04);
	border-color: rgba(255, 255, 255, 0.1);
	box-shadow: none;
}

/* …but not the focus ring: the rule above outranks the plain :focus-within
   selector, so without this the composer loses every focus cue the moment the
   conversation thread opens. */
body.app-next-body.nxt-chat-merged .nxt-chat-input-wrap:focus-within {
	border-color: rgba(255, 255, 255, 0.45);
	box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.28);
}

/* ── Mobile ────────────────────────────────────────────────────────────── */

@media (max-width: 720px) {
	.nxt-preset-cluster {
		display: none; /* presets hidden on mobile to free up header space */
	}
}

@media (max-width: 640px) {
	.nxt-brand-tag { display: none; }
	/* Phone header: the account chip becomes the dot alone. A handle, a display
	   name or an email all have to share ~230px with the brand, the two icon
	   buttons and Explore, and any of them long enough pushed the chip (and the
	   menu behind it) off the edge of the screen. The identity still reads out
	   through the button's aria-label and sits at the top of its menu. */
	#nav-user-label { display: none; }
	.nxt-user-btn {
		padding: 9px;
		border-radius: 50%;
		gap: 0;
	}
	/* The shared nav's own presence dot (.nav-user::before) is the whole chip at
	   this size; a second dot beside it just reads as a rendering glitch. */
	.nxt-user-dot { display: none; }
	.nxt-more { padding: 7px 8px; }
	.nxt-more-menu a,
	.nxt-more-menu button { padding: 12px 14px; font-size: 15px; min-height: 44px; }
	.nxt-action kbd { display: none; }
	.nxt-action { padding: 7px 10px; font-size: 12px; }
	.nxt-action span { display: none; }
	.nxt-action--primary span { display: inline; }
	.nxt-chat-dock { bottom: 64px; }
	.nxt-action-bar--secondary { bottom: 12px; }
	/* `justify-content: center` on a scroll container pushes the overflow past
	   BOTH edges, and the leading half can never be scrolled back into view. The
	   flex-start fallback keeps every chip reachable on engines without `safe`. */
	.nxt-chat-chips {
		max-width: 100%;
		overflow-x: auto;
		flex-wrap: nowrap;
		padding-bottom: 2px;
		justify-content: flex-start;
		justify-content: safe center;
	}
	.nxt-chat-chip { white-space: nowrap; flex: none; }
	.nxt-anim-sheet { bottom: 130px; max-height: 50vh; }
	.nxt-first-hint { font-size: 11.5px; padding: 6px 6px 6px 12px; max-width: calc(100vw - 24px); }
	.nxt-icon-btn { width: 28px; height: 28px; }
	.nxt-help__grid { grid-template-columns: 80px 1fr; font-size: 12px; }
	body.app-next-body .nich-panel {
		left: 50%;
		right: auto;
		transform: translateX(-50%);
		width: min(640px, calc(100vw - 32px));
		bottom: 142px;
		max-height: 45vh;
	}
	body.app-next-body.nxt-chat-active .nxt-chat-dock {
		left: 50%;
		right: auto;
		transform: translateX(-50%);
		width: min(640px, calc(100vw - 32px));
	}
}

/* Below ~380px the wordmark plus the full action cluster no longer fit on one
   line. The header does not scroll, so the overflow pushed the sign-in link
   clean off the right edge where it could not be read or tapped. Drop to the
   mark alone; the link keeps its "three.ws home" label for assistive tech. */
@media (max-width: 380px) {
	.nxt-brand-text { display: none; }
	.nxt-header { padding: 0 12px 0 10px; }
	.nxt-header-right { gap: 6px; }
}

/* Hide the production dat.gui by default — controls live inside the viewer
   panel that's intentionally not surfaced in this UX preview. Power users
   can re-enable via the explore menu (link routes to /app). */
body.app-next-body .dg.ac { display: none !important; }

/* ══════════════════════════════════════════════════════════════════════
   Visitor Agent Card — floating read-only identity card for visitors
   ══════════════════════════════════════════════════════════════════ */

.nxt-visitor-card {
	position: fixed;
	top: 72px;
	left: 20px;
	z-index: 45;
	width: 280px;
	animation: nxt-visitor-card-in 0.4s ease-out;
	pointer-events: none;
}

.nxt-visitor-card__inner {
	pointer-events: auto;
	background: linear-gradient(
		168deg,
		rgba(16, 16, 24, 0.92) 0%,
		rgba(10, 10, 16, 0.95) 100%
	);
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: 16px;
	backdrop-filter: blur(22px) saturate(140%);
	-webkit-backdrop-filter: blur(22px) saturate(140%);
	box-shadow:
		0 20px 60px rgba(0, 0, 0, 0.55),
		inset 0 1px 0 rgba(255, 255, 255, 0.04);
	padding: 16px;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.nxt-visitor-card__head {
	display: flex;
	align-items: center;
	gap: 12px;
}

.nxt-visitor-card__avatar {
	width: 44px;
	height: 44px;
	border-radius: 50%;
	flex-shrink: 0;
	overflow: hidden;
	border: 2px solid rgba(139, 92, 246, 0.4);
	box-shadow: 0 0 12px rgba(139, 92, 246, 0.2);
	position: relative;
	background: rgba(255, 255, 255, 0.04);
}

.nxt-visitor-card__avatar-shimmer {
	position: absolute;
	inset: 0;
	background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.06) 50%, transparent 70%);
	background-size: 200% 100%;
	animation: nxt-shimmer 1.8s ease-in-out infinite;
}

.nxt-visitor-card__avatar-img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.nxt-visitor-card__info {
	flex: 1;
	min-width: 0;
}

.nxt-visitor-card__name {
	font-family: var(--font-display);
	font-size: 16px;
	font-weight: 600;
	color: #f5f5f7;
	letter-spacing: -0.01em;
	margin: 0;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.nxt-visitor-card__status {
	display: flex;
	align-items: center;
	gap: 5px;
	font-size: 11px;
	color: rgba(255, 255, 255, 0.45);
	margin-top: 2px;
}

.nxt-visitor-card__dot {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--nxt-ink);
	box-shadow: 0 0 6px rgba(255, 255, 255, 0.35);
	animation: nxt-dot-pulse 2.5s ease infinite;
	flex-shrink: 0;
}

.nxt-visitor-card__desc {
	font-size: 12.5px;
	line-height: 1.5;
	color: rgba(255, 255, 255, 0.55);
	margin: 0;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.nxt-visitor-card__skills {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
}

.nxt-visitor-card__skill {
	font-size: 10px;
	padding: 3px 8px;
	border-radius: 999px;
	background: rgba(139, 92, 246, 0.12);
	color: rgba(255, 255, 255, 0.55);
	border: 1px solid rgba(139, 92, 246, 0.18);
	white-space: nowrap;
}

.nxt-visitor-card__actions {
	display: flex;
	gap: 8px;
	padding-top: 4px;
}

.nxt-visitor-card__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 5px;
	padding: 8px 14px;
	border-radius: 10px;
	font-size: 12.5px;
	font-weight: 500;
	font-family: inherit;
	text-decoration: none;
	border: 1px solid rgba(255, 255, 255, 0.1);
	background: rgba(255, 255, 255, 0.04);
	color: rgba(255, 255, 255, 0.8);
	cursor: pointer;
	transition: all var(--duration-fast) var(--ease-standard);
}

.nxt-visitor-card__btn:hover {
	border-color: rgba(255, 255, 255, 0.22);
	background: rgba(255, 255, 255, 0.08);
	color: #fff;
}

.nxt-visitor-card__btn--primary {
	flex: 1;
	background: linear-gradient(180deg, rgba(139, 92, 246, 0.9), rgba(124, 58, 237, 0.9));
	border-color: rgba(255, 255, 255, 0.30);
	color: #fff;
	box-shadow: 0 4px 16px rgba(139, 92, 246, 0.28);
}

.nxt-visitor-card__btn--primary:hover {
	background: linear-gradient(180deg, rgba(151, 109, 255, 1), rgba(139, 92, 246, 1));
	border-color: rgba(255, 255, 255, 0.55);
	box-shadow: 0 6px 20px rgba(139, 92, 246, 0.38);
}

.nxt-visitor-card__btn--share {
	padding: 8px 12px;
}

@keyframes nxt-visitor-card-in {
	from {
		opacity: 0;
		transform: translateY(10px) translateX(-6px);
	}
	to {
		opacity: 1;
		transform: translateY(0) translateX(0);
	}
}

@keyframes nxt-dot-pulse {
	0%, 100% { opacity: 1; }
	50% { opacity: 0.45; }
}

@keyframes nxt-shimmer {
	0% { background-position: -200% 0; }
	100% { background-position: 200% 0; }
}

/* Fade the visitor card when chrome auto-hides */
.nxt-chrome-hidden .nxt-visitor-card {
	opacity: 0;
	pointer-events: none;
	transition: opacity var(--duration-slow) var(--ease-standard);
}
.nxt-visitor-card {
	transition: opacity var(--duration-slow) var(--ease-standard);
}

/* ══════════════════════════════════════════════════════════════════════
   Mobile Agent Strip — compact floating bar for agent context
   ══════════════════════════════════════════════════════════════════ */

.nxt-mobile-agent-strip {
	display: none;
}

@media (max-width: 720px) {
	.nxt-mobile-agent-strip {
		display: flex;
		position: fixed;
		top: 52px;
		left: 12px;
		right: 12px;
		z-index: 44;
		align-items: center;
		gap: 10px;
		padding: 8px 10px 8px 8px;
		background: linear-gradient(
			180deg,
			rgba(14, 14, 22, 0.92) 0%,
			rgba(10, 10, 16, 0.95) 100%
		);
		border: 1px solid rgba(255, 255, 255, 0.08);
		border-radius: 14px;
		backdrop-filter: blur(20px) saturate(140%);
		-webkit-backdrop-filter: blur(20px) saturate(140%);
		box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
		animation: nxt-strip-in 0.35s ease-out;
	}

	.nxt-mobile-agent-strip[hidden] {
		display: none;
	}

	/* On mobile, hide the desktop visitor card */
	.nxt-visitor-card {
		display: none !important;
	}
}

.nxt-mobile-agent-strip__avatar {
	width: 32px;
	height: 32px;
	border-radius: 50%;
	flex-shrink: 0;
	background: rgba(255, 255, 255, 0.06);
	border: 1.5px solid rgba(139, 92, 246, 0.4);
	position: relative;
	overflow: hidden;
}

.nxt-mobile-agent-strip__dot {
	position: absolute;
	bottom: -1px;
	right: -1px;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--nxt-ink);
	border: 2px solid rgba(10, 10, 10, 0.95);
	box-shadow: 0 0 4px rgba(255, 255, 255, 0.3);
}

.nxt-mobile-agent-strip__info {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 1px;
}

.nxt-mobile-agent-strip__name {
	font-size: 13px;
	font-weight: 600;
	color: #f5f5f7;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	letter-spacing: -0.01em;
}

.nxt-mobile-agent-strip__desc {
	font-size: 10.5px;
	color: rgba(255, 255, 255, 0.4);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.nxt-mobile-agent-strip__share {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	flex-shrink: 0;
	border-radius: 50%;
	border: 1px solid rgba(255, 255, 255, 0.1);
	background: rgba(255, 255, 255, 0.04);
	color: rgba(255, 255, 255, 0.55);
	cursor: pointer;
	transition: all var(--duration-fast) var(--ease-standard);
}

.nxt-mobile-agent-strip__share:hover,
.nxt-mobile-agent-strip__share:active {
	color: #fff;
	border-color: rgba(255, 255, 255, 0.25);
	background: rgba(255, 255, 255, 0.08);
}

@keyframes nxt-strip-in {
	from {
		opacity: 0;
		transform: translateY(-8px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* Fade with chrome auto-hide */
.nxt-chrome-hidden .nxt-mobile-agent-strip {
	opacity: 0;
	pointer-events: none;
	transition: opacity var(--duration-slow) var(--ease-standard);
}
.nxt-mobile-agent-strip {
	transition: opacity var(--duration-slow) var(--ease-standard);
}

/* ══════════════════════════════════════════════════════════════════════
   Social Share Buttons
   ══════════════════════════════════════════════════════════════════ */

.nxt-share-social {
	padding-top: 4px;
}

.nxt-share-social__row {
	display: flex;
	gap: 8px;
	margin-top: 8px;
}

.nxt-share-social__btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border-radius: 10px;
	border: 1px solid rgba(255, 255, 255, 0.1);
	background: rgba(255, 255, 255, 0.04);
	color: rgba(255, 255, 255, 0.55);
	cursor: pointer;
	transition: all var(--duration-fast) var(--ease-standard);
}

.nxt-share-social__btn:hover {
	color: #fff;
	border-color: rgba(255, 255, 255, 0.22);
	background: rgba(255, 255, 255, 0.08);
	transform: translateY(-1px);
}

.nxt-share-social__btn:active {
	transform: translateY(0);
}

/* ══════════════════════════════════════════════════════════════════════
   Poster Skeleton — branded shimmer placeholder during GLB load
   ══════════════════════════════════════════════════════════════════ */

.nxt-poster-skeleton {
	position: absolute;
	inset: 0;
	z-index: 4;
	display: flex;
	align-items: center;
	justify-content: center;
	pointer-events: none;
	overflow: hidden;
	transition: opacity var(--duration-slow) var(--ease-standard);
}

.nxt-poster-skeleton[hidden] {
	display: none;
}

.nxt-poster-skeleton--fading {
	opacity: 0;
}

.nxt-poster-skeleton__silhouette {
	width: 140px;
	height: 260px;
	border-radius: 70px 70px 40px 40px;
	background: linear-gradient(
		180deg,
		rgba(139, 92, 246, 0.06) 0%,
		rgba(139, 92, 246, 0.03) 40%,
		rgba(255, 255, 255, 0.02) 100%
	);
	border: 1px solid rgba(255, 255, 255, 0.03);
	position: relative;
}

.nxt-poster-skeleton__shimmer {
	position: absolute;
	inset: 0;
	background: linear-gradient(
		110deg,
		transparent 25%,
		rgba(139, 92, 246, 0.05) 37%,
		rgba(255, 255, 255, 0.04) 50%,
		rgba(139, 92, 246, 0.05) 63%,
		transparent 75%
	);
	background-size: 250% 100%;
	animation: nxt-shimmer 2.2s ease-in-out infinite;
}

/* Floor glow intensifies during skeleton state to suggest something is loading */
.nxt-poster-skeleton:not([hidden]) ~ .nxt-stage-floor {
	opacity: 0.7;
}

@media (max-width: 640px) {
	.nxt-poster-skeleton__silhouette {
		width: 100px;
		height: 200px;
	}
}

/* ── Object mode ─────────────────────────────────────────────────────────────
   Set by app-next-overlay.js when the viewer opens a prop (/app#…&kind=object).
   A 3D object is inspected and modified, not conversed with, so the agent
   surface is removed and the bar carries view + modify actions instead. */
html[data-app-mode="object"] #nxt-chat-dock,
html[data-app-mode="object"] #nxt-agent-bubble,
html[data-app-mode="object"] #nxt-visitor-card,
html[data-app-mode="object"] #nxt-first-hint {
	display: none !important;
}

/* ── Interactive states (QB-07) ────────────────────────────────────────────
   The account button is in the dashboard shell on every dashboard page, and it
   was the one chrome control that did not answer the pointer. */
.nxt-user-btn {
	transition:
		background var(--duration-fast) var(--ease-standard),
		border-color var(--duration-fast) var(--ease-standard);
}

.nxt-user-btn:hover {
	background: var(--surface-3);
	border-color: var(--nxt-stroke-strong);
}