/******************************************************************************
 * Golden Ratio Design System
 * φ = 1.618 — all spacing and type follow a phi-based scale
 */

.save-toast {
	position: fixed;
	bottom: 20px;
	left: 50%;
	transform: translateX(-50%);
	background: #14141c;
	color: #eee;
	border: 1px solid #2a2a36;
	border-radius: 10px;
	padding: 10px 16px;
	font-size: 14px;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
	z-index: 9999;
}
.save-toast a {
	color: #9a8cff;
}

:root {
	/* Phi ratio */
	--phi: 1.618;

	/* Spacing scale (each step × φ) */
	--space-3xs: 0.146rem; /* ~2.3px  */
	--space-2xs: 0.236rem; /* ~3.8px  */
	--space-xs: 0.382rem; /* ~6.1px  */
	--space-sm: 0.618rem; /* ~9.9px  */
	--space-md: 1rem; /* 16px    */
	--space-lg: 1.618rem; /* ~25.9px */
	--space-xl: 2.618rem; /* ~41.9px */
	--space-2xl: 4.236rem; /* ~67.8px */

	/* Typography scale (minor third adjusted to phi) */
	--text-xs: 0.618rem; /* ~9.9px  */
	--text-sm: 0.764rem; /* ~12.2px */
	--text-base: 1rem; /* 16px    */
	--text-lg: 1.236rem; /* ~19.8px */
	--text-xl: 1.618rem; /* ~25.9px */
	--text-2xl: 2.618rem; /* ~41.9px */

	/* Line heights — golden ratio */
	--leading-tight: 1.382;
	--leading-normal: 1.618;
	--leading-loose: 2.058;

	/* Radii — phi-based */
	--radius-sm: 3px; /* ~5/φ   */
	--radius-md: 5px; /* base   */
	--radius-lg: 8px; /* ~5×φ   */

	/* Header height */
	--header-h: 3.5rem;

	/* Font stacks */
	--font-display: 'Space Grotesk', 'Inter', system-ui, sans-serif;
	--font-body: 'Inter', system-ui, sans-serif;
	--font-mono: 'SF Mono', 'Fira Code', ui-monospace, monospace;

	/* Accent */
	--accent: #8b5cf6;
	--accent-soft: rgba(139, 92, 246, 0.18);
}

html,
body {
	margin: 0;
	padding: 0;
	font-family: 'Inter', 'Raleway', sans-serif;
	background: #000;
	height: 100%;
	overflow: hidden;
	color: #e0e0e0;
	font-size: var(--text-base);
	line-height: var(--leading-normal);
}

* {
	box-sizing: border-box;
}

body {
	display: flex;
	flex-direction: column;
}

.wrap {
	display: flex;
	flex-direction: column;
	width: 100vw;
	flex-grow: 1;
	position: relative;
}

.viewer-container {
	flex-grow: 1;
	position: relative;
	min-height: 0;
}

.dropzone {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: var(--space-md);
	padding: var(--space-sm) var(--space-lg);
	padding-bottom: max(var(--space-sm), env(safe-area-inset-bottom, 0));
	padding-left: max(var(--space-lg), env(safe-area-inset-left, 0));
	padding-right: max(var(--space-lg), env(safe-area-inset-right, 0));
	background: rgba(255, 255, 255, 0.03);
	border-top: 1px solid rgba(255, 255, 255, 0.06);
	z-index: 1;
}

.placeholder {
	display: none;
}

.placeholder:hover {
	border-color: rgba(255, 255, 255, 0.3);
	background: rgba(255, 255, 255, 0.05);
}

.placeholder p {
	font-size: var(--text-lg);
	color: rgba(255, 255, 255, 0.4);
	font-weight: 300;
	letter-spacing: 0.02em;
}

.viewer {
	width: 100%;
	height: 100%;
	position: absolute;
	top: 0;
	left: 0;
	z-index: 0;
}

.model-info {
	position: absolute;
	bottom: 20px;
	left: 20px;
	z-index: 5;
	pointer-events: none;
	opacity: 0;
	transform: translateY(8px);
	animation: fadeInUp 0.4s ease 0.3s forwards;
}

.annotation-label {
	position: absolute;
	z-index: 4;
	pointer-events: none;
	transform: translate(-50%, -100%) translateY(-8px);
	opacity: 0;
	animation: fadeInUp 0.3s ease 0.5s forwards;
}

@keyframes fadeInUp {
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.axes {
	width: 100px;
	height: 100px;
	margin: 20px;
	padding: 0px;
	position: absolute;
	left: 0px;
	bottom: 0px;
	z-index: 10;
	pointer-events: none;
}

/******************************************************************************
 * Header
 */

header {
	display: flex;
	background: rgba(0, 0, 0, 0.8);
	backdrop-filter: blur(20px);
	-webkit-backdrop-filter: blur(20px);
	padding: 0 var(--space-lg);
	padding-top: env(safe-area-inset-top, 0);
	padding-left: max(var(--space-lg), env(safe-area-inset-left, 0));
	padding-right: max(var(--space-lg), env(safe-area-inset-right, 0));
	height: calc(var(--header-h) + env(safe-area-inset-top, 0));
	line-height: var(--header-h);
	align-items: center;
	overflow-x: auto;
	overflow-y: hidden;
	white-space: nowrap;
	border-bottom: 1px solid rgba(255, 255, 255, 0.06);
	z-index: 1;

	-webkit-app-region: drag;
}

header h1 {
	color: #fff;
	font-family: var(--font-display);
	font-size: var(--text-lg);
	font-weight: 600;
	line-height: var(--header-h);
	margin: 0;
	letter-spacing: -0.01em;
	display: flex;
	align-items: center;
	gap: var(--space-xs);
}

header h1 > a {
	color: inherit;
	font-size: inherit;
	text-decoration: inherit;
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

header h1 .wordmark-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: linear-gradient(135deg, #a78bfa 0%, #6366f1 100%);
	box-shadow: 0 0 10px rgba(139, 92, 246, 0.6);
	display: inline-block;
}

.features-nav {
	margin-left: auto;
	display: flex;
	gap: var(--space-md);
	-webkit-app-region: no-drag;
	align-items: center;
}

.features-nav a {
	color: rgba(255, 255, 255, 0.5);
	text-decoration: none;
	font-size: var(--text-sm);
	font-weight: 500;
	letter-spacing: -0.005em;
	padding: 0.35rem 0.7rem;
	border-radius: var(--radius-md);
	transition:
		color 0.18s ease,
		background 0.18s ease;
	position: relative;
}

.features-nav a:hover {
	color: #fff;
	background: rgba(255, 255, 255, 0.04);
}

.features-nav a.active {
	color: #fff;
	background: rgba(255, 255, 255, 0.06);
}

.features-nav a.active::after {
	content: '';
	position: absolute;
	left: 50%;
	bottom: -2px;
	transform: translateX(-50%);
	width: 18px;
	height: 2px;
	border-radius: 2px;
	background: linear-gradient(90deg, #a78bfa, #6366f1);
}

.nav-sign-in {
	border: 1px solid rgba(255, 255, 255, 0.12);
	border-radius: var(--radius-md);
}

.nav-sign-in.signed-in {
	display: none;
}

.gui-wrap {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	pointer-events: none;
	transition:
		opacity 0.2s ease,
		transform 0.2s ease;
}

.gui-wrap--hidden {
	opacity: 0;
	transform: translateX(12px);
	pointer-events: none !important;
	visibility: hidden;
}

.gui-wrap > .main {
	pointer-events: all;
	max-height: 100%;
	overflow: auto;
}

/* Controls toggle button (top-right) */
.gui-toggle {
	position: absolute;
	top: var(--space-sm);
	right: var(--space-sm);
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 6px 10px;
	background: rgba(18, 18, 26, 0.85);
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: var(--radius-md);
	color: rgba(255, 255, 255, 0.6);
	font-family: var(--font-body);
	font-size: var(--text-xs);
	font-weight: 500;
	letter-spacing: 0.02em;
	cursor: pointer;
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	transition:
		color 0.18s,
		background 0.18s,
		border-color 0.18s;
	z-index: 30;
}

.gui-toggle:hover {
	color: #fff;
	background: rgba(28, 28, 38, 0.9);
	border-color: rgba(255, 255, 255, 0.18);
}

.gui-toggle--active {
	color: #fff;
	background: var(--accent-soft);
	border-color: rgba(139, 92, 246, 0.45);
}

.gui-toggle__label {
	font-size: 11px;
}

.dg li.gui-stats:not(.folder) {
	height: auto;
}

/******************************************************************************
 * dat.gui dark theme overrides
 */

.dg.ac {
	z-index: 10 !important;
}

.dg.main .close-button.close-bottom {
	background-color: #111 !important;
	color: rgba(255, 255, 255, 0.5) !important;
	border-top: 1px solid rgba(255, 255, 255, 0.06) !important;
}

.dg.main .close-button.close-bottom:hover {
	background-color: #1a1a1a !important;
	color: rgba(255, 255, 255, 0.8) !important;
}

.dg.a {
	margin-right: 0 !important;
}

.dg li:not(.folder) {
	background: #0a0a0a !important;
	border-bottom: 1px solid rgba(255, 255, 255, 0.04) !important;
}

.dg li.folder {
	border-bottom: 0 !important;
}

.dg li.title {
	background: #111 !important;
	border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
}

.dg .cr.function .property-name {
	width: 100% !important;
}

.dg .c select {
	background: #1a1a1a !important;
	color: #ccc !important;
	border: 1px solid rgba(255, 255, 255, 0.1) !important;
	border-radius: var(--radius-sm) !important;
}

.dg .c input[type='text'] {
	background: #1a1a1a !important;
	color: #ccc !important;
	border: 1px solid rgba(255, 255, 255, 0.1) !important;
	border-radius: var(--radius-sm) !important;
}

@media screen and (max-width: 700px) {
	header {
		padding: 0 1em;
		height: 3rem;
		line-height: 3rem;
	}

	header h1 {
		font-size: 1em;
		line-height: 3rem;
	}

	.placeholder {
		display: none;
	}

	.placeholder p {
		font-size: 1rem;
	}

	.upload-btn label {
		padding: var(--space-xs) var(--space-md);
		font-size: var(--text-sm);
	}

	.dropzone {
		flex-direction: column;
		gap: var(--space-xs);
		padding: var(--space-xs) var(--space-md);
	}

	footer {
		bottom: auto;
		top: calc(3rem + 0.5em);
		left: 0.5em;
		right: auto;
	}

	.gui-wrap {
		max-width: 65vw;
	}

	.axes {
		width: 60px;
		height: 60px;
		margin: 10px;
		bottom: 0;
	}

	.model-info {
		bottom: 10px;
		left: 10px;
		transform: scale(0.85) translateY(8px);
		transform-origin: bottom left;
	}

	@keyframes fadeInUp {
		to {
			opacity: 1;
			transform: scale(0.85) translateY(0);
		}
	}

	.annotation-label {
		transform: scale(0.8) translate(-50%, -100%) translateY(-6px);
		transform-origin: center bottom;
	}

	.report {
		padding: var(--space-md);
		max-width: 100vw;
	}

	.report-table th,
	.report-table td {
		padding: var(--space-2xs) var(--space-xs);
		font-size: var(--text-sm);
	}

	.report-toggle {
		left: 10px;
		height: 36px;
	}

	.report-toggle-text {
		line-height: 36px;
		font-size: 0.75em;
	}

	.report-toggle-close {
		width: 36px;
		height: 36px;
		line-height: 36px;
	}
}

/******************************************************************************
 * Footer
 */

footer {
	position: absolute;
	bottom: calc(var(--space-sm) + env(safe-area-inset-bottom, 0));
	right: calc(var(--space-md) + env(safe-area-inset-right, 0));
	display: flex;
	align-items: center;
	gap: var(--space-sm);
	font-family: var(--font-mono);
	font-size: var(--text-sm);
	color: #fff;
	z-index: 2;
	pointer-events: none;
}

footer a {
	pointer-events: all;
	color: rgba(255, 255, 255, 0.55);
	text-decoration: none;
	transition: color 0.18s ease;
	display: inline-flex;
	align-items: center;
}

footer a:hover {
	color: #fff;
}

footer a svg {
	vertical-align: middle;
}

footer .separator {
	color: rgba(255, 255, 255, 0.2);
	font-size: 10px;
}

/******************************************************************************
 * Upload Button
 *
 * https://tympanus.net/Tutorials/CustomFileInputs/
 */

.upload-btn {
	margin: 0;
}

.upload-btn input {
	width: 0.1px;
	height: 0.1px;
	opacity: 0;
	overflow: hidden;
	position: absolute;
	z-index: -1;
}

.upload-btn label {
	color: rgba(255, 255, 255, 0.5);
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: var(--radius-lg);
	transition: all 0.25s ease;
	font-size: var(--text-sm);
	font-weight: 500;
	text-overflow: ellipsis;
	white-space: nowrap;
	cursor: pointer;
	display: inline-block;
	overflow: hidden;
	padding: var(--space-sm) var(--space-lg);
	letter-spacing: 0.02em;
}

.upload-btn label:hover {
	background: rgba(255, 255, 255, 0.08);
	color: #fff;
	border-color: rgba(255, 255, 255, 0.25);
}

.upload-btn label:active {
	background: rgba(255, 255, 255, 0.12);
	color: #fff;
	border-color: rgba(255, 255, 255, 0.35);
	transform: scale(0.97);
}

.drop-hint {
	color: rgba(255, 255, 255, 0.25);
	font-size: var(--text-sm);
	font-weight: 300;
	letter-spacing: 0.02em;
}

@media screen and (max-width: 700px) {
	.drop-hint {
		display: none;
	}
}

.upload-btn svg {
	width: 1em;
	height: 1em;
	vertical-align: middle;
	fill: currentColor;
	margin-top: -0.25em;
	margin-right: 0.25em;
}

/******************************************************************************
 * Validation report
 */

.report {
	padding: var(--space-lg);
	max-width: 860px;
}

.report h1 {
	margin-top: 0;
}

.report p,
.report ul {
	line-height: var(--leading-normal);
}

.report-table {
	text-align: left;
	border-collapse: collapse;
	width: 100%;
}

.report-table thead tr {
	background: #1a1a1a;
	color: rgba(255, 255, 255, 0.9);
}

.report-table th,
.report-table td {
	padding: var(--space-xs) var(--space-md);
	color: rgba(255, 255, 255, 0.7);
}

.report-table tr:nth-child(2n) {
	background: rgba(255, 255, 255, 0.04);
}

.report-table tr:nth-child(odd) {
	background: rgba(255, 255, 255, 0.02);
}

.report-table-wrap {
	overflow-x: auto;
	margin-bottom: var(--space-md);
}

.report-section-heading {
	font-size: 1.05rem;
	margin: var(--space-md) 0 var(--space-xs);
	padding-left: var(--space-md);
	border-left: 4px solid #888;
}

.report-count {
	font-weight: normal;
	opacity: 0.7;
	font-size: 0.9em;
}

.report-banner {
	display: flex;
	align-items: center;
	gap: var(--space-md);
	padding: var(--space-md);
	border-radius: 6px;
	margin-bottom: var(--space-md);
	font-size: 0.95rem;
}

.report-banner-clean {
	background: rgba(139, 195, 74, 0.12);
	border: 1px solid rgba(139, 195, 74, 0.35);
	color: #8bc34a;
}

.report-banner-issues {
	background: rgba(244, 67, 54, 0.08);
	border: 1px solid rgba(244, 67, 54, 0.25);
	color: rgba(255, 255, 255, 0.85);
}

.report-banner-icon {
	font-size: 1.5rem;
	font-weight: bold;
}

.report-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: var(--space-md);
	flex-wrap: wrap;
}

.report-download {
	display: inline-block;
	padding: 6px 12px;
	font-size: 0.85rem;
	border: 1px solid rgba(255, 255, 255, 0.18);
	border-radius: 6px;
	color: rgba(255, 255, 255, 0.85);
	text-decoration: none;
	transition: background-color 120ms ease;
}

.report-download:hover {
	background: rgba(255, 255, 255, 0.08);
}

/******************************************************************************
 * CSS Spinner
 *
 * http://tobiasahlin.com/spinkit/
 */

.spinner {
	width: 40px;
	height: 40px;
	position: absolute;
	left: 50%;
	top: 50%;
	margin: -20px;

	background-color: rgba(255, 255, 255, 0.15);

	border-radius: 100%;
	-webkit-animation: sk-scaleout 1s infinite ease-in-out;
	animation: sk-scaleout 1s infinite ease-in-out;
}

@-webkit-keyframes sk-scaleout {
	0% {
		-webkit-transform: scale(0);
	}
	100% {
		-webkit-transform: scale(1);
		opacity: 0;
	}
}

@keyframes sk-scaleout {
	0% {
		-webkit-transform: scale(0);
		transform: scale(0);
	}
	100% {
		-webkit-transform: scale(1);
		transform: scale(1);
		opacity: 0;
	}
}

/******************************************************************************
 * Screenshot flash feedback
 */

.screenshot-flash {
	position: absolute;
	inset: 0;
	background: #fff;
	opacity: 0;
	pointer-events: none;
	z-index: 100;
	animation: screenshot-flash 0.3s ease-out forwards;
}

@keyframes screenshot-flash {
	0% {
		opacity: 0.5;
	}
	100% {
		opacity: 0;
	}
}

/******************************************************************************
 * Golden Ratio Dev Grid Overlay — toggle with Alt+G
 *
 * Horizontal: splits viewport at 38.2% / 61.8%
 * Vertical:   splits viewport at 38.2% / 61.8%
 * Plus rule-of-thirds (33.3% / 66.6%) for comparison
 */

.phi-grid {
	display: none;
	position: fixed;
	inset: 0;
	z-index: 9999;
	pointer-events: none;
	mix-blend-mode: difference;
}

.phi-grid.visible {
	display: block;
}

/* Vertical golden split */
.phi-grid::before,
.phi-grid::after {
	content: '';
	position: absolute;
	top: 0;
	bottom: 0;
	width: 1px;
}

.phi-grid::before {
	left: 38.2%;
	background: rgba(255, 215, 0, 0.5);
}

.phi-grid::after {
	left: 61.8%;
	background: rgba(255, 215, 0, 0.5);
}

/* Horizontal golden split + thirds via inner spans */
.phi-grid-h::before,
.phi-grid-h::after {
	content: '';
	position: absolute;
	left: 0;
	right: 0;
	height: 1px;
}

.phi-grid-h::before {
	top: 38.2%;
	background: rgba(255, 215, 0, 0.5);
}

.phi-grid-h::after {
	top: 61.8%;
	background: rgba(255, 215, 0, 0.5);
}

/* Rule-of-thirds lines (dimmer) */
.phi-grid-thirds::before,
.phi-grid-thirds::after {
	content: '';
	position: absolute;
	top: 0;
	bottom: 0;
	width: 1px;
	background: rgba(0, 191, 255, 0.25);
}

.phi-grid-thirds::before {
	left: 33.333%;
}
.phi-grid-thirds::after {
	left: 66.666%;
}

.phi-grid-thirds-h::before,
.phi-grid-thirds-h::after {
	content: '';
	position: absolute;
	left: 0;
	right: 0;
	height: 1px;
	background: rgba(0, 191, 255, 0.25);
}

.phi-grid-thirds-h::before {
	top: 33.333%;
}
.phi-grid-thirds-h::after {
	top: 66.666%;
}

.phi-grid-label {
	position: fixed;
	top: var(--space-xs);
	left: 50%;
	transform: translateX(-50%);
	font-family: 'SF Mono', 'Fira Code', monospace;
	font-size: var(--text-xs);
	color: rgba(255, 215, 0, 0.7);
	background: rgba(0, 0, 0, 0.7);
	padding: var(--space-3xs) var(--space-xs);
	border-radius: var(--radius-sm);
	z-index: 10000;
	pointer-events: none;
	display: none;
}

.phi-grid.visible ~ .phi-grid-label {
	display: block;
}

/******************************************************************************
 * Nich Agent Panel
 */

.nich-toggle {
	position: fixed;
	bottom: var(--space-lg);
	left: var(--space-lg);
	width: 48px;
	height: 48px;
	border-radius: 50%;
	border: 1px solid rgba(255, 255, 255, 0.1);
	background: rgba(10, 10, 10, 0.9);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	color: rgba(255, 255, 255, 0.6);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 0.25s ease;
	z-index: 50;
}

.nich-toggle:hover {
	background: rgba(255, 255, 255, 0.08);
	color: #fff;
	border-color: rgba(255, 255, 255, 0.25);
	transform: scale(1.05);
}

.nich-toggle.active {
	color: #fff;
	border-color: rgba(255, 255, 255, 0.3);
}

.nich-panel {
	position: fixed;
	bottom: 5em;
	left: var(--space-lg);
	width: 320px;
	max-height: 480px;
	display: flex;
	flex-direction: column;
	background: rgba(10, 10, 10, 0.95);
	backdrop-filter: blur(20px);
	-webkit-backdrop-filter: blur(20px);
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: var(--radius-lg);
	overflow: hidden;
	z-index: 50;
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.nich-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: var(--space-sm) var(--space-md);
	border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.nich-title {
	font-size: var(--text-sm);
	font-weight: 500;
	color: rgba(255, 255, 255, 0.8);
	letter-spacing: 0.03em;
}

.nich-close {
	background: none;
	border: none;
	color: rgba(255, 255, 255, 0.4);
	font-size: var(--text-lg);
	cursor: pointer;
	padding: 0;
	line-height: 1;
	transition: color 0.2s ease;
}

.nich-close:hover {
	color: #fff;
}

.nich-messages {
	flex: 1;
	overflow-y: auto;
	padding: var(--space-sm);
	display: flex;
	flex-direction: column;
	gap: var(--space-xs);
	min-height: 200px;
	max-height: 300px;
}

.nich-message {
	font-size: var(--text-sm);
	line-height: var(--leading-normal);
	padding: var(--space-xs) var(--space-sm);
	border-radius: var(--radius-lg);
	max-width: 85%;
	word-wrap: break-word;
}

.nich-message.agent {
	background: rgba(255, 255, 255, 0.06);
	color: rgba(255, 255, 255, 0.7);
	align-self: flex-start;
	border-bottom-left-radius: var(--radius-sm);
}

.nich-message.user {
	background: rgba(255, 255, 255, 0.12);
	color: #fff;
	align-self: flex-end;
	border-bottom-right-radius: var(--radius-sm);
}

.nich-controls {
	display: flex;
	gap: var(--space-xs);
	padding: var(--space-sm);
	border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.nich-input {
	flex: 1;
	background: rgba(255, 255, 255, 0.05);
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: var(--radius-lg);
	padding: var(--space-xs) var(--space-sm);
	color: #fff;
	font-family: 'Inter', sans-serif;
	font-size: var(--text-sm);
	outline: none;
	transition: border-color 0.2s ease;
}

.nich-input::placeholder {
	color: rgba(255, 255, 255, 0.25);
}

.nich-input:focus {
	border-color: rgba(255, 255, 255, 0.2);
}

.nich-send {
	background: rgba(255, 255, 255, 0.06);
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: var(--radius-lg);
	color: rgba(255, 255, 255, 0.5);
	cursor: pointer;
	padding: var(--space-xs) var(--space-sm);
	display: flex;
	align-items: center;
	transition: all 0.2s ease;
}

.nich-send:hover {
	background: rgba(255, 255, 255, 0.1);
	color: #fff;
}

.nich-mic-row {
	display: flex;
	justify-content: center;
	padding: 0 var(--space-sm) var(--space-sm);
}

.nich-mic {
	background: rgba(255, 255, 255, 0.04);
	border: 1px solid rgba(255, 255, 255, 0.06);
	border-radius: 50%;
	width: 32px;
	height: 32px;
	display: flex;
	align-items: center;
	justify-content: center;
	color: rgba(255, 255, 255, 0.35);
	cursor: pointer;
	transition: all 0.2s ease;
}

.nich-mic:hover {
	background: rgba(255, 255, 255, 0.08);
	color: rgba(255, 255, 255, 0.7);
}

.nich-mic.active {
	background: rgba(255, 80, 80, 0.15);
	border-color: rgba(255, 80, 80, 0.3);
	color: #ff5050;
}

@media screen and (max-width: 700px) {
	.nich-toggle {
		bottom: var(--space-md);
		left: var(--space-md);
		width: 42px;
		height: 42px;
	}

	.nich-panel {
		bottom: 4em;
		left: var(--space-sm);
		right: var(--space-sm);
		width: auto;
		max-height: 60vh;
	}
}

/******************************************************************************
 * ERC-8004 Agent Registration
 */

.erc8004-register {
	position: absolute;
	inset: 0;
	z-index: 20;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, 0.85);
	backdrop-filter: blur(24px);
	-webkit-backdrop-filter: blur(24px);
	overflow-y: auto;
	padding: var(--space-lg);
}

/* Page mode — /deploy renders inside app.html shell, not as a modal overlay. */
.deploy-page,
.explore-page {
	display: block;
	width: 100%;
	min-height: calc(100vh - var(--header-h));
	padding: var(--space-xl) var(--space-lg) var(--space-2xl);
	overflow-y: auto;
}

/* /a/<chainId>/<agentId> — overlay card that tells the viewer whose agent they're looking at. */
.onchain-card {
	position: fixed;
	left: var(--space-md);
	bottom: var(--space-md);
	z-index: 50;
	max-width: 320px;
	padding: var(--space-sm) var(--space-md);
	background: rgba(8, 8, 20, 0.85);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: var(--radius-md);
	color: #fff;
	font-size: var(--text-sm);
	line-height: 1.35;
	pointer-events: none;
}
.onchain-card__name {
	font-weight: 600;
}
.onchain-card__sub {
	margin-top: 2px;
	color: rgba(255, 255, 255, 0.55);
	font-size: var(--text-xs);
}
.onchain-card__desc {
	margin-top: var(--space-xs);
	color: rgba(255, 255, 255, 0.8);
	font-size: var(--text-xs);
	max-height: 4.2em;
	overflow: hidden;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
}
.onchain-card__err {
	color: #ff7a7a;
}

/* /discover — cross-chain on-chain avatar browser.
 *
 * Search ANY input (address / ENS / tx / agent ID / agent:// URI) and see every
 * matching ERC-8004 registered 3D avatar as a gallery, grouped by chain.
 * Implementation: public/discover/discover.js → src/erc8004/resolve-avatar.js.
 */
.explore-shell {
	max-width: 1200px;
	margin: 0 auto;
}

/* Hero */
.explore-hero {
	padding: var(--space-xl) 0 var(--space-lg);
}
.explore-hero-inner {
	max-width: 780px;
	margin: 0 auto;
	text-align: center;
}
.explore-eyebrow {
	display: inline-block;
	padding: var(--space-3xs) var(--space-sm);
	margin-bottom: var(--space-sm);
	background: rgba(99, 102, 241, 0.12);
	border: 1px solid rgba(99, 102, 241, 0.3);
	border-radius: 999px;
	font-size: var(--text-xs);
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: rgba(165, 180, 252, 0.95);
}
.explore-title {
	margin: 0 0 var(--space-sm);
	font-size: clamp(1.8rem, 4vw, 2.6rem);
	line-height: 1.1;
	letter-spacing: -0.02em;
	color: #fff;
}
.explore-subtitle {
	margin: 0 auto var(--space-lg);
	max-width: 560px;
	color: rgba(255, 255, 255, 0.65);
	line-height: 1.5;
}

/* Search form */
.explore-form {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: var(--space-xs);
	margin: 0 auto;
	max-width: 680px;
}
.explore-input-wrap {
	display: flex;
	width: 100%;
	background: rgba(255, 255, 255, 0.04);
	border: 1px solid rgba(255, 255, 255, 0.12);
	border-radius: 14px;
	overflow: hidden;
	transition:
		border-color 0.15s ease,
		box-shadow 0.15s ease;
}
.explore-input-wrap:focus-within {
	border-color: rgba(123, 97, 255, 0.65);
	box-shadow: 0 0 0 3px rgba(123, 97, 255, 0.18);
}
.explore-input {
	flex: 1;
	min-width: 0;
	padding: var(--space-md) var(--space-lg);
	background: transparent;
	border: none;
	outline: none;
	color: #fff;
	font-family: inherit;
	font-size: var(--text-base);
}
.explore-input::placeholder {
	color: rgba(255, 255, 255, 0.35);
}
.explore-input-meta {
	font-size: var(--text-xs);
	color: rgba(255, 255, 255, 0.45);
	min-height: 1em;
}
.explore-inputmeta--ok {
	color: rgba(134, 239, 172, 0.9);
}
.explore-inputmeta--warn {
	color: rgba(253, 186, 116, 0.9);
}

/* Examples / recent searches */
.explore-examples {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	align-items: center;
	gap: var(--space-xs);
	margin-top: var(--space-md);
}
.explore-examples-lbl {
	color: rgba(255, 255, 255, 0.4);
	font-size: var(--text-xs);
	margin-right: var(--space-2xs);
}
.explore-example {
	padding: var(--space-3xs) var(--space-sm);
	background: rgba(255, 255, 255, 0.05);
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: 999px;
	color: rgba(255, 255, 255, 0.75);
	font-family: inherit;
	font-size: var(--text-xs);
	cursor: pointer;
	transition:
		background 0.15s ease,
		border-color 0.15s ease;
}
.explore-example:hover {
	background: rgba(255, 255, 255, 0.1);
	border-color: rgba(255, 255, 255, 0.2);
	color: #fff;
}

/* Controls bar (chain chips + progress) */
.explore-controls {
	position: sticky;
	top: var(--header-h, 0);
	z-index: 3;
	padding: var(--space-sm) 0;
	margin: 0 0 var(--space-md);
	background: rgba(8, 8, 20, 0.82);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.explore-controls-row {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: var(--space-sm);
}
.explore-controls-lbl {
	color: rgba(255, 255, 255, 0.45);
	font-size: var(--text-xs);
	text-transform: uppercase;
	letter-spacing: 0.08em;
}
.explore-controls-spacer {
	flex: 1;
}
.explore-chain-chips {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--space-2xs);
}
.explore-chain-group {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-2xs);
}
.explore-chain-group--testnet {
	opacity: 0.85;
}
.explore-chain-divider {
	color: rgba(255, 255, 255, 0.25);
	padding: 0 var(--space-2xs);
}
.explore-chain-chip {
	display: inline-flex;
	align-items: center;
	gap: var(--space-2xs);
	padding: 3px var(--space-sm);
	background: rgba(255, 255, 255, 0.04);
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: 999px;
	color: rgba(255, 255, 255, 0.55);
	font-family: inherit;
	font-size: var(--text-xs);
	cursor: pointer;
	transition:
		background 0.15s ease,
		border-color 0.15s ease,
		color 0.15s ease;
}
.explore-chain-chip:hover {
	color: #fff;
	border-color: rgba(255, 255, 255, 0.2);
}
.explore-chain-chip--active {
	background: rgba(123, 97, 255, 0.18);
	border-color: rgba(123, 97, 255, 0.5);
	color: #fff;
}
.explore-chain-chip--testnet .explore-chain-dot {
	background: rgba(253, 186, 116, 0.8);
}
.explore-chain-dot {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: rgba(134, 239, 172, 0.8);
}
.explore-chain-chip--active.explore-chain-chip .explore-chain-dot {
	box-shadow: 0 0 6px currentColor;
}
.explore-chain-presets-btn {
	padding: 3px var(--space-sm);
	background: transparent;
	border: 1px dashed rgba(255, 255, 255, 0.15);
	border-radius: 999px;
	color: rgba(255, 255, 255, 0.5);
	font-family: inherit;
	font-size: var(--text-xs);
	cursor: pointer;
	transition: all 0.15s ease;
}
.explore-chain-presets-btn:hover {
	color: #fff;
	border-color: rgba(255, 255, 255, 0.3);
}

/* Progress HUD */
.explore-progress {
	display: inline-flex;
	align-items: center;
	gap: var(--space-xs);
	font-size: var(--text-xs);
	color: rgba(255, 255, 255, 0.6);
}
.explore-progress-spinner {
	width: 12px;
	height: 12px;
	border: 2px solid rgba(255, 255, 255, 0.15);
	border-top-color: rgba(165, 180, 252, 0.95);
	border-radius: 50%;
	animation: explore-spin 0.7s linear infinite;
}
@keyframes explore-spin {
	to {
		transform: rotate(360deg);
	}
}

/* Results area */
.explore-results {
	padding-bottom: var(--space-2xl);
}
.explore-summary {
	margin: var(--space-md) 0;
}
.explore-summary-head {
	display: flex;
	align-items: baseline;
	flex-wrap: wrap;
	gap: var(--space-sm);
}
.explore-summary-title {
	margin: 0;
	font-size: var(--text-lg);
	color: #fff;
	font-weight: 500;
}
.explore-summary-stat {
	color: rgba(255, 255, 255, 0.5);
	font-size: var(--text-xs);
}
.explore-summary-sub {
	margin-top: var(--space-2xs);
	color: rgba(255, 255, 255, 0.55);
	font-size: var(--text-xs);
	word-break: break-all;
}
.explore-summary-sub code {
	background: rgba(255, 255, 255, 0.05);
	padding: 2px 6px;
	border-radius: 4px;
}

/* Filter chips */
.explore-filterbar {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-2xs);
	margin: var(--space-sm) 0 var(--space-md);
}
.explore-filter {
	padding: 4px var(--space-md);
	background: rgba(255, 255, 255, 0.04);
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: 999px;
	color: rgba(255, 255, 255, 0.65);
	font-family: inherit;
	font-size: var(--text-xs);
	cursor: pointer;
	transition:
		background 0.15s ease,
		border-color 0.15s ease;
}
.explore-filter:hover {
	background: rgba(255, 255, 255, 0.08);
	color: #fff;
}
.explore-filter--active {
	background: rgba(123, 97, 255, 0.2);
	border-color: rgba(123, 97, 255, 0.55);
	color: #fff;
}

/* Grid + cards */
.explore-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
	gap: var(--space-md);
}
.explore-card {
	display: flex;
	flex-direction: column;
	background: rgba(255, 255, 255, 0.03);
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: 14px;
	overflow: hidden;
	transition:
		transform 0.15s ease,
		border-color 0.15s ease,
		box-shadow 0.15s ease;
}
.explore-card:hover {
	transform: translateY(-2px);
	border-color: rgba(123, 97, 255, 0.4);
	box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}
.explore-card-thumb {
	position: relative;
	aspect-ratio: 1 / 1;
	background: linear-gradient(135deg, #131226 0%, #1a1a2e 100%);
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	text-decoration: none;
}
.explore-card-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}
.explore-card-ph {
	font-size: 2.4rem;
	opacity: 0.35;
}
.explore-chain-badge {
	position: absolute;
	top: var(--space-2xs);
	left: var(--space-2xs);
	padding: 2px var(--space-xs);
	background: rgba(8, 8, 20, 0.75);
	border: 1px solid rgba(255, 255, 255, 0.15);
	border-radius: 999px;
	color: #fff;
	font-size: 10px;
	font-weight: 600;
	letter-spacing: 0.04em;
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
}
.explore-chain-badge--testnet {
	color: rgba(253, 186, 116, 0.95);
	border-color: rgba(253, 186, 116, 0.35);
}
.explore-card-3dpill {
	position: absolute;
	right: var(--space-2xs);
	bottom: var(--space-2xs);
	padding: 3px var(--space-sm);
	background: rgba(123, 97, 255, 0.9);
	border-radius: 999px;
	color: #fff;
	font-size: 10px;
	font-weight: 600;
	letter-spacing: 0.04em;
}
.explore-card-body {
	display: flex;
	flex-direction: column;
	gap: var(--space-2xs);
	padding: var(--space-sm) var(--space-md) var(--space-md);
}
.explore-card-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: var(--space-xs);
}
.explore-card-title {
	color: #fff;
	font-weight: 600;
	text-decoration: none;
	line-height: 1.25;
	overflow: hidden;
	display: -webkit-box;
	-webkit-line-clamp: 1;
	-webkit-box-orient: vertical;
}
.explore-card-title:hover {
	text-decoration: underline;
}
.explore-card-id {
	color: rgba(255, 255, 255, 0.4);
	font-size: var(--text-xs);
	font-variant-numeric: tabular-nums;
}
.explore-card-desc {
	margin: 0;
	color: rgba(255, 255, 255, 0.65);
	font-size: var(--text-xs);
	line-height: 1.45;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.explore-card-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	min-height: 16px;
}
.explore-tag {
	padding: 1px var(--space-xs);
	background: rgba(255, 255, 255, 0.06);
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: 4px;
	color: rgba(255, 255, 255, 0.7);
	font-size: 10px;
	font-weight: 600;
	letter-spacing: 0.04em;
}
.explore-tag--3d {
	color: rgba(165, 243, 252, 0.95);
	border-color: rgba(165, 243, 252, 0.35);
	background: rgba(14, 165, 233, 0.08);
}
.explore-tag--x402 {
	color: rgba(253, 230, 138, 0.95);
	border-color: rgba(253, 230, 138, 0.35);
	background: rgba(245, 158, 11, 0.08);
}
.explore-owner {
	color: rgba(255, 255, 255, 0.5);
	font-size: var(--text-xs);
	text-decoration: none;
	font-family: ui-monospace, Menlo, monospace;
}
.explore-owner:hover {
	color: #fff;
	text-decoration: underline;
}
.explore-card-err {
	color: rgba(248, 113, 113, 0.85);
	font-size: var(--text-xs);
}
.explore-card-actions {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-2xs);
	margin-top: var(--space-xs);
}

/* Buttons (explore-scoped, not the erc8004 ones) */
.explore-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--space-2xs);
	padding: var(--space-sm) var(--space-lg);
	background: rgba(255, 255, 255, 0.08);
	border: 1px solid rgba(255, 255, 255, 0.12);
	border-radius: 10px;
	color: #fff;
	font-family: inherit;
	font-size: var(--text-sm);
	font-weight: 500;
	cursor: pointer;
	text-decoration: none;
	transition:
		background 0.15s ease,
		border-color 0.15s ease,
		transform 0.1s ease;
}
.explore-btn:hover {
	background: rgba(255, 255, 255, 0.14);
	border-color: rgba(255, 255, 255, 0.2);
}
.explore-btn:active {
	transform: scale(0.98);
}
.explore-btn--sm {
	padding: 4px var(--space-sm);
	font-size: var(--text-xs);
	border-radius: 8px;
}
.explore-btn--primary {
	background: linear-gradient(135deg, #7b61ff 0%, #5e42ff 100%);
	border-color: rgba(123, 97, 255, 0.7);
	color: #fff;
	box-shadow: 0 4px 14px rgba(123, 97, 255, 0.35);
}
.explore-btn--primary:hover {
	background: linear-gradient(135deg, #8a73ff 0%, #6f56ff 100%);
	border-color: rgba(158, 138, 255, 0.9);
}
.explore-btn--ghost {
	background: transparent;
	border-color: rgba(255, 255, 255, 0.1);
	color: rgba(255, 255, 255, 0.65);
}
.explore-btn--ghost:hover {
	color: #fff;
	background: rgba(255, 255, 255, 0.05);
}

/* Skeleton cards (loading state) */
.explore-card--skel {
	background: rgba(255, 255, 255, 0.02);
	pointer-events: none;
}
.explore-skel-img {
	aspect-ratio: 1 / 1;
	background: linear-gradient(
		110deg,
		rgba(255, 255, 255, 0.03) 30%,
		rgba(255, 255, 255, 0.07) 50%,
		rgba(255, 255, 255, 0.03) 70%
	);
	background-size: 200% 100%;
	animation: explore-shimmer 1.4s ease-in-out infinite;
}
.explore-skel-line {
	height: 10px;
	margin: var(--space-sm) var(--space-md);
	background: rgba(255, 255, 255, 0.05);
	border-radius: 4px;
}
.explore-skel-line--short {
	width: 60%;
}
@keyframes explore-shimmer {
	0% {
		background-position: 200% 0;
	}
	100% {
		background-position: -200% 0;
	}
}

/* Featured (no-query) header */
.explore-featured-head {
	margin: var(--space-md) 0 var(--space-md);
}
.explore-featured-head h2 {
	margin: 0 0 var(--space-2xs);
	font-size: var(--text-lg);
	color: #fff;
	font-weight: 500;
}

/* Empty + error states */
.explore-empty,
.explore-error {
	padding: var(--space-xl);
	text-align: center;
	background: rgba(255, 255, 255, 0.02);
	border: 1px dashed rgba(255, 255, 255, 0.1);
	border-radius: 14px;
	color: rgba(255, 255, 255, 0.7);
}
.explore-empty h3,
.explore-error strong {
	color: #fff;
	font-weight: 600;
	display: block;
	margin: 0 0 var(--space-xs);
}
.explore-empty p,
.explore-error p {
	margin: 0 auto var(--space-md);
	max-width: 520px;
	font-size: var(--text-sm);
	color: rgba(255, 255, 255, 0.6);
}
.explore-empty-art {
	font-size: 3rem;
	margin-bottom: var(--space-sm);
}
.explore-empty-ideas {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: var(--space-xs);
}
.explore-muted {
	color: rgba(255, 255, 255, 0.5);
	font-size: var(--text-xs);
}

@media screen and (max-width: 640px) {
	.explore-title {
		font-size: 2rem;
	}
	.explore-controls {
		position: static;
	}
	.explore-grid {
		grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
		gap: var(--space-sm);
	}
	.explore-card-thumb .explore-chain-badge {
		font-size: 9px;
	}
}

/* Create-tab Step 0 — quickstart mode picker above the 4-step wizard. */
.erc8004-quickstart {
	margin-bottom: var(--space-md);
	padding: var(--space-sm) var(--space-md);
	background: rgba(255, 255, 255, 0.03);
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: 10px;
}
.erc8004-quickstart-title {
	font-weight: 600;
	margin-bottom: var(--space-xs);
}
.erc8004-quickstart-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
	gap: var(--space-sm);
}
.erc8004-quickstart-btn {
	display: block;
	text-align: left;
	padding: var(--space-sm);
	background: rgba(255, 255, 255, 0.04);
	border: 1px solid rgba(255, 255, 255, 0.12);
	border-radius: 8px;
	color: inherit;
	cursor: pointer;
	transition:
		border-color 0.12s ease,
		background 0.12s ease;
}
.erc8004-quickstart-btn:hover:not(:disabled) {
	border-color: rgba(255, 255, 255, 0.3);
	background: rgba(255, 255, 255, 0.07);
}
.erc8004-quickstart-btn:disabled {
	opacity: 0.45;
	cursor: not-allowed;
}
.erc8004-quickstart-btn-title {
	font-weight: 600;
	margin-bottom: 2px;
}
.erc8004-quickstart-btn-hint {
	font-size: var(--text-xs);
	color: rgba(255, 255, 255, 0.6);
}

.erc8004-register--page {
	position: static;
	inset: auto;
	z-index: auto;
	display: block;
	background: transparent;
	backdrop-filter: none;
	-webkit-backdrop-filter: none;
	padding: 0;
}

.erc8004-register--page .erc8004-card {
	margin: 0 auto;
	background: rgba(255, 255, 255, 0.02);
}

.erc8004-card {
	width: 100%;
	max-width: 480px;
	background: rgba(255, 255, 255, 0.04);
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: var(--radius-lg);
	padding: var(--space-xl) var(--space-lg);
}

.erc8004-title {
	margin: 0 0 var(--space-3xs);
	font-size: var(--text-xl);
	font-weight: 500;
	color: #fff;
	letter-spacing: 0.02em;
}

.erc8004-subtitle {
	margin: 0 0 var(--space-lg);
	font-size: var(--text-sm);
	color: rgba(255, 255, 255, 0.45);
	font-weight: 300;
}

.erc8004-section {
	margin-bottom: var(--space-md);
}

.erc8004-label {
	display: block;
	margin-bottom: var(--space-sm);
	font-size: var(--text-sm);
	color: rgba(255, 255, 255, 0.5);
	font-weight: 400;
}

.erc8004-input {
	display: block;
	width: 100%;
	margin-top: var(--space-3xs);
	padding: var(--space-xs) var(--space-sm);
	background: rgba(255, 255, 255, 0.06);
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: var(--radius-sm);
	color: #fff;
	font-family: inherit;
	font-size: var(--text-base);
	outline: none;
	transition: border-color 0.2s;
}

.erc8004-input:focus {
	border-color: rgba(255, 255, 255, 0.3);
}

.erc8004-textarea {
	resize: vertical;
	min-height: 3.6em;
}

.erc8004-file-drop {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	height: 80px;
	margin-top: var(--space-3xs);
	border: 2px dashed rgba(255, 255, 255, 0.12);
	border-radius: var(--radius-md);
	cursor: pointer;
	transition:
		border-color 0.2s,
		background 0.2s;
}

.erc8004-file-drop:hover,
.erc8004-file-drop--active {
	border-color: rgba(255, 255, 255, 0.3);
	background: rgba(255, 255, 255, 0.03);
}

.erc8004-file-input {
	position: absolute;
	inset: 0;
	opacity: 0;
	cursor: pointer;
}

.erc8004-file-text {
	font-size: var(--text-sm);
	color: rgba(255, 255, 255, 0.4);
	pointer-events: none;
}

.erc8004-btn {
	display: inline-flex;
	align-items: center;
	gap: var(--space-xs);
	padding: var(--space-xs) var(--space-md);
	border: 1px solid rgba(255, 255, 255, 0.15);
	border-radius: var(--radius-md);
	background: rgba(255, 255, 255, 0.06);
	color: #fff;
	font-family: inherit;
	font-size: var(--text-sm);
	font-weight: 500;
	cursor: pointer;
	transition:
		background 0.2s,
		border-color 0.2s;
}

.erc8004-btn:hover:not(:disabled) {
	background: rgba(255, 255, 255, 0.12);
	border-color: rgba(255, 255, 255, 0.25);
}

.erc8004-btn:disabled {
	opacity: 0.35;
	cursor: not-allowed;
}

.erc8004-btn--register {
	width: 100%;
	justify-content: center;
	padding: var(--space-sm) var(--space-md);
	background: rgba(139, 92, 246, 0.25);
	border-color: rgba(139, 92, 246, 0.45);
}

.erc8004-btn--register:hover:not(:disabled) {
	background: rgba(139, 92, 246, 0.45);
}

.erc8004-btn--view {
	margin-top: var(--space-sm);
}

.erc8004-wallet-addr {
	display: inline-block;
	margin-left: var(--space-xs);
	font-size: var(--text-xs);
	color: rgba(255, 255, 255, 0.5);
	font-family: monospace;
}

.erc8004-log {
	max-height: 120px;
	overflow-y: auto;
	margin-top: var(--space-sm);
	font-size: var(--text-xs);
	font-family: monospace;
	color: rgba(255, 255, 255, 0.5);
}

.erc8004-log-line {
	padding: 2px 0;
}

.erc8004-log-error {
	color: #f87171;
}

.erc8004-result {
	margin-top: var(--space-md);
	padding: var(--space-md);
	background: rgba(34, 197, 94, 0.08);
	border: 1px solid rgba(34, 197, 94, 0.2);
	border-radius: var(--radius-md);
}

.erc8004-checkmark {
	display: block;
	font-size: 2rem;
	color: #22c55e;
	margin-bottom: var(--space-xs);
}

.erc8004-result h3 {
	margin: 0 0 var(--space-xs);
	font-size: var(--text-lg);
	font-weight: 500;
	color: #fff;
}

.erc8004-result-dl {
	display: grid;
	grid-template-columns: auto 1fr;
	gap: var(--space-3xs) var(--space-sm);
	margin: 0;
	font-size: var(--text-sm);
}

.erc8004-result-dl dt {
	color: rgba(255, 255, 255, 0.45);
	font-weight: 400;
}

.erc8004-result-dl dd {
	margin: 0;
	color: #fff;
	font-family: monospace;
	word-break: break-all;
}

@media screen and (max-width: 700px) {
	.erc8004-card {
		padding: var(--space-lg) var(--space-md);
	}
}

/* ── Tabbed Agent Studio (extends the basic register styles above) ──── */

.erc8004-card--wide {
	max-width: 880px;
}

.erc8004-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--space-md);
	margin-bottom: var(--space-md);
	flex-wrap: wrap;
}

.erc8004-brand {
	display: inline-flex;
	align-items: center;
	gap: var(--space-xs);
	font-size: var(--text-sm);
	color: rgba(255, 255, 255, 0.85);
}

.erc8004-brand-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 2px 8px;
	border-radius: var(--radius-sm);
	background: linear-gradient(135deg, rgba(99, 102, 241, 0.6), rgba(236, 72, 153, 0.55));
	color: #fff;
	font-size: var(--text-xs);
	font-weight: 600;
	letter-spacing: 0.04em;
}

.erc8004-brand-title b {
	font-weight: 600;
	color: #fff;
}

.erc8004-controls {
	display: inline-flex;
	align-items: center;
	gap: var(--space-xs);
	flex-wrap: wrap;
}

.erc8004-chain-select {
	padding: 6px 10px;
	background: rgba(255, 255, 255, 0.06);
	border: 1px solid rgba(255, 255, 255, 0.12);
	border-radius: var(--radius-sm);
	color: #fff;
	font-family: inherit;
	font-size: var(--text-xs);
	cursor: pointer;
}

.erc8004-btn--wallet.erc8004-btn--connected {
	background: rgba(34, 197, 94, 0.18);
	border-color: rgba(34, 197, 94, 0.4);
}

.erc8004-btn--primary {
	background: rgba(139, 92, 246, 0.35);
	border-color: rgba(99, 102, 241, 0.5);
}

.erc8004-btn--primary:hover:not(:disabled) {
	background: rgba(99, 102, 241, 0.45);
}

.erc8004-btn--ghost {
	background: transparent;
}

.erc8004-btn--x {
	padding: 4px 8px;
}

.erc8004-btn--close {
	padding: 4px 10px;
	font-size: var(--text-base);
	line-height: 1;
}

.erc8004-stats {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: var(--space-sm);
	margin-bottom: var(--space-md);
}

.erc8004-stat {
	padding: var(--space-sm);
	background: rgba(255, 255, 255, 0.03);
	border: 1px solid rgba(255, 255, 255, 0.06);
	border-radius: var(--radius-md);
	text-align: center;
}

.erc8004-stat-val {
	font-size: var(--text-lg);
	font-weight: 600;
	color: #fff;
	font-variant-numeric: tabular-nums;
}

.erc8004-stat-lbl {
	font-size: var(--text-xs);
	color: rgba(255, 255, 255, 0.45);
	margin-top: 2px;
}

.erc8004-tabs {
	display: flex;
	gap: 2px;
	padding: 4px;
	margin-bottom: var(--space-md);
	background: rgba(255, 255, 255, 0.03);
	border: 1px solid rgba(255, 255, 255, 0.06);
	border-radius: var(--radius-md);
	overflow-x: auto;
}

.erc8004-tab {
	flex: 1;
	min-width: max-content;
	padding: 8px 14px;
	border: 0;
	background: transparent;
	color: rgba(255, 255, 255, 0.6);
	font-family: inherit;
	font-size: var(--text-sm);
	font-weight: 500;
	cursor: pointer;
	border-radius: var(--radius-sm);
	transition:
		background 0.2s,
		color 0.2s;
}

.erc8004-tab:hover {
	color: #fff;
}

.erc8004-tab--active {
	background: rgba(255, 255, 255, 0.1);
	color: #fff;
}

.erc8004-tab-body {
	min-height: 280px;
}

.erc8004-wizard {
	display: flex;
	flex-direction: column;
	gap: var(--space-md);
}

.erc8004-steps {
	display: flex;
	gap: var(--space-xs);
	margin: 0;
	padding: 0;
	list-style: none;
}

.erc8004-step {
	flex: 1;
	display: flex;
	align-items: center;
	gap: var(--space-xs);
	padding: var(--space-xs) var(--space-sm);
	background: rgba(255, 255, 255, 0.03);
	border: 1px solid rgba(255, 255, 255, 0.06);
	border-radius: var(--radius-sm);
	color: rgba(255, 255, 255, 0.4);
	font-size: var(--text-xs);
}

.erc8004-step--active {
	background: var(--accent-soft);
	border-color: rgba(99, 102, 241, 0.45);
	color: #fff;
}

.erc8004-step--done {
	color: rgba(34, 197, 94, 0.9);
	border-color: rgba(34, 197, 94, 0.3);
}

.erc8004-step-num {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.1);
	font-weight: 600;
}

.erc8004-step--active .erc8004-step-num {
	background: rgba(99, 102, 241, 0.7);
}

.erc8004-wizard-body {
	padding: var(--space-md);
	background: rgba(255, 255, 255, 0.02);
	border: 1px solid rgba(255, 255, 255, 0.06);
	border-radius: var(--radius-md);
}

.erc8004-wizard-nav {
	display: flex;
	justify-content: space-between;
	gap: var(--space-xs);
	margin-top: var(--space-md);
}

.erc8004-wizard-nav > :only-child {
	margin-left: auto;
}

.erc8004-h3 {
	margin: 0 0 var(--space-3xs);
	font-size: var(--text-lg);
	font-weight: 500;
	color: #fff;
}

.erc8004-h4 {
	margin: 0 0 var(--space-xs);
	font-size: var(--text-base);
	font-weight: 500;
	color: #fff;
}

.erc8004-p {
	margin: 0 0 var(--space-sm);
	font-size: var(--text-sm);
	color: rgba(255, 255, 255, 0.6);
	line-height: 1.5;
}

.erc8004-req {
	color: #f87171;
}

.erc8004-hint {
	margin: -2px 0 var(--space-sm);
	font-size: var(--text-xs);
	color: rgba(255, 255, 255, 0.35);
}

.erc8004-muted {
	color: rgba(255, 255, 255, 0.4);
	font-size: var(--text-sm);
}

.erc8004-small {
	font-size: var(--text-xs);
}

.erc8004-row {
	display: flex;
	gap: var(--space-xs);
	align-items: center;
	flex-wrap: wrap;
	margin-bottom: var(--space-sm);
}

.erc8004-link {
	color: #a5b4fc;
	text-decoration: none;
	cursor: pointer;
	background: none;
	border: 0;
	padding: 0;
	font: inherit;
}

.erc8004-link:hover {
	text-decoration: underline;
	color: #c7d2fe;
}

.erc8004-alert {
	padding: var(--space-xs) var(--space-sm);
	margin-bottom: var(--space-sm);
	background: rgba(245, 158, 11, 0.1);
	border: 1px solid rgba(245, 158, 11, 0.3);
	border-radius: var(--radius-sm);
	color: rgba(253, 224, 71, 0.9);
	font-size: var(--text-sm);
}

.erc8004-tag {
	display: inline-block;
	padding: 2px 8px;
	background: rgba(255, 255, 255, 0.08);
	border-radius: 999px;
	font-size: var(--text-xs);
	color: rgba(255, 255, 255, 0.7);
	font-variant-numeric: tabular-nums;
}

.erc8004-clip {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.erc8004-services {
	display: flex;
	flex-direction: column;
	gap: var(--space-xs);
	margin-bottom: var(--space-sm);
}

.erc8004-svc-row {
	display: grid;
	grid-template-columns: 140px 160px 1fr auto;
	gap: var(--space-xs);
	align-items: center;
}

.erc8004-input--tight {
	width: auto;
}

.erc8004-summary {
	display: grid;
	grid-template-columns: auto 1fr;
	gap: var(--space-3xs) var(--space-md);
	margin: 0 0 var(--space-sm);
	padding: var(--space-sm);
	background: rgba(255, 255, 255, 0.03);
	border-radius: var(--radius-sm);
	font-size: var(--text-sm);
}

.erc8004-summary dt {
	color: rgba(255, 255, 255, 0.45);
}

.erc8004-summary dd {
	margin: 0;
	color: #fff;
	word-break: break-word;
}

.erc8004-agent-card {
	padding: var(--space-sm);
	background: rgba(255, 255, 255, 0.03);
	border: 1px solid rgba(255, 255, 255, 0.06);
	border-radius: var(--radius-md);
	margin-bottom: var(--space-xs);
}

.erc8004-agent-card-inner {
	display: grid;
	grid-template-columns: 72px 1fr;
	gap: var(--space-sm);
	align-items: start;
}

.erc8004-agent-card-img {
	width: 72px;
	height: 72px;
	border-radius: var(--radius-sm);
	overflow: hidden;
	background: rgba(255, 255, 255, 0.05);
	display: flex;
	align-items: center;
	justify-content: center;
}

.erc8004-agent-card-img img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.erc8004-agent-card-ph {
	font-size: 2rem;
	opacity: 0.5;
}

.erc8004-agent-card-head {
	display: flex;
	align-items: center;
	gap: var(--space-xs);
	margin-bottom: var(--space-3xs);
	color: #fff;
	font-weight: 500;
}

.erc8004-agent-card-actions {
	display: inline-flex;
	gap: var(--space-sm);
	margin-top: var(--space-xs);
	font-size: var(--text-xs);
}

.erc8004-template-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: var(--space-sm);
}

.erc8004-template {
	display: flex;
	flex-direction: column;
	gap: var(--space-3xs);
	padding: var(--space-md);
	background: rgba(255, 255, 255, 0.03);
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: var(--radius-md);
	color: #fff;
	font-family: inherit;
	text-align: left;
	cursor: pointer;
	transition:
		background 0.2s,
		border-color 0.2s,
		transform 0.15s;
}

.erc8004-template:hover {
	background: rgba(255, 255, 255, 0.06);
	border-color: rgba(99, 102, 241, 0.45);
	transform: translateY(-1px);
}

.erc8004-template-emoji {
	font-size: 1.75rem;
	line-height: 1;
}

.erc8004-template-name {
	font-weight: 500;
	font-size: var(--text-sm);
}

.erc8004-template-desc {
	font-size: var(--text-xs);
	color: rgba(255, 255, 255, 0.5);
	line-height: 1.4;
}

.erc8004-history-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--space-sm);
	padding: var(--space-xs) var(--space-sm);
	background: rgba(255, 255, 255, 0.03);
	border: 1px solid rgba(255, 255, 255, 0.06);
	border-radius: var(--radius-sm);
	margin-bottom: var(--space-3xs);
	font-size: var(--text-sm);
}

.erc8004-history-main {
	min-width: 0;
	flex: 1;
}

.erc8004-history-main code {
	font-size: var(--text-xs);
	color: rgba(255, 255, 255, 0.5);
}

.erc8004-toast {
	position: fixed;
	bottom: var(--space-lg);
	left: 50%;
	transform: translateX(-50%);
	padding: var(--space-sm) var(--space-md);
	background: rgba(20, 20, 25, 0.95);
	border: 1px solid rgba(255, 255, 255, 0.12);
	border-radius: var(--radius-md);
	color: #fff;
	font-size: var(--text-sm);
	z-index: 100;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.erc8004-toast--error {
	background: rgba(127, 29, 29, 0.95);
	border-color: rgba(248, 113, 113, 0.4);
}

@media screen and (max-width: 700px) {
	.erc8004-stats {
		grid-template-columns: 1fr;
	}
	.erc8004-svc-row {
		grid-template-columns: 1fr;
	}
	.erc8004-agent-card-inner {
		grid-template-columns: 56px 1fr;
	}
	.erc8004-agent-card-img {
		width: 56px;
		height: 56px;
	}
	.erc8004-step-lbl {
		display: none;
	}
}

/******************************************************************************
 * Create Avatar Button
 */

.create-avatar-btn {
	display: inline-flex;
	align-items: center;
	gap: var(--space-xs);
	padding: var(--space-sm) var(--space-lg);
	background: rgba(123, 47, 247, 0.15);
	border: 1px solid rgba(123, 47, 247, 0.3);
	border-radius: var(--radius-lg);
	color: rgba(255, 255, 255, 0.7);
	font-family: inherit;
	font-size: var(--text-sm);
	font-weight: 500;
	cursor: pointer;
	transition: all 0.25s ease;
	letter-spacing: 0.02em;
}

.create-avatar-btn:hover {
	background: rgba(123, 47, 247, 0.3);
	color: #fff;
	border-color: rgba(123, 47, 247, 0.5);
}

.create-avatar-btn:active {
	background: rgba(123, 47, 247, 0.4);
	transform: scale(0.97);
}

.create-avatar-btn svg {
	width: 1em;
	height: 1em;
	fill: currentColor;
}

@media screen and (max-width: 700px) {
	.create-avatar-btn span {
		display: none;
	}

	.create-avatar-btn {
		padding: var(--space-xs) var(--space-sm);
	}
}

/******************************************************************************
 * Make this a widget — appears once a model is loaded
 */
.make-widget-btn {
	display: inline-flex;
	align-items: center;
	gap: var(--space-xs);
	padding: var(--space-sm) var(--space-lg);
	background: rgba(0, 229, 160, 0.1);
	border: 1px solid rgba(0, 229, 160, 0.3);
	border-radius: var(--radius-lg);
	color: rgba(255, 255, 255, 0.85);
	font-family: inherit;
	font-size: var(--text-sm);
	font-weight: 500;
	text-decoration: none;
	cursor: pointer;
	transition: all 0.25s ease;
	letter-spacing: 0.02em;
}
.make-widget-btn:hover {
	background: rgba(0, 229, 160, 0.22);
	color: #fff;
	border-color: rgba(0, 229, 160, 0.55);
}
.make-widget-btn:focus-visible {
	outline: 2px solid rgba(0, 229, 160, 0.7);
	outline-offset: 2px;
}
.make-widget-btn[hidden] {
	display: none;
}
.make-widget-btn svg {
	width: 1em;
	height: 1em;
}
@media screen and (max-width: 700px) {
	.make-widget-btn span {
		display: none;
	}
	.make-widget-btn {
		padding: var(--space-xs) var(--space-sm);
	}
}

.save-to-account-btn {
	display: inline-flex;
	align-items: center;
	gap: var(--space-xs);
	padding: var(--space-sm) var(--space-lg);
	background: rgba(139, 92, 246, 0.12);
	border: 1px solid rgba(139, 92, 246, 0.35);
	border-radius: var(--radius-lg);
	color: rgba(255, 255, 255, 0.9);
	font-family: inherit;
	font-size: var(--text-sm);
	font-weight: 500;
	text-decoration: none;
	cursor: pointer;
	transition: all 0.25s ease;
	letter-spacing: 0.02em;
}
.save-to-account-btn:hover {
	background: rgba(139, 92, 246, 0.24);
	color: #fff;
	border-color: rgba(139, 92, 246, 0.6);
}
.save-to-account-btn:focus-visible {
	outline: 2px solid rgba(139, 92, 246, 0.7);
	outline-offset: 2px;
}
.save-to-account-btn[hidden] {
	display: none;
}
.save-to-account-btn[disabled] {
	opacity: 0.6;
	pointer-events: none;
}
.save-to-account-btn svg {
	width: 1em;
	height: 1em;
}
@media screen and (max-width: 700px) {
	.save-to-account-btn span {
		display: none;
	}
	.save-to-account-btn {
		padding: var(--space-xs) var(--space-sm);
	}
}

.deploy-onchain-btn {
	display: inline-flex;
	align-items: center;
	gap: var(--space-xs);
	padding: var(--space-sm) var(--space-lg);
	background: rgba(108, 99, 255, 0.1);
	border: 1px solid rgba(108, 99, 255, 0.4);
	border-radius: var(--radius-lg);
	color: rgba(255, 255, 255, 0.92);
	font-family: inherit;
	font-size: var(--text-sm);
	font-weight: 500;
	text-decoration: none;
	cursor: pointer;
	transition: all 0.25s ease;
	letter-spacing: 0.02em;
}
.deploy-onchain-btn:hover {
	background: rgba(108, 99, 255, 0.22);
	color: #fff;
	border-color: rgba(108, 99, 255, 0.65);
}
.deploy-onchain-btn:focus-visible {
	outline: 2px solid rgba(108, 99, 255, 0.7);
	outline-offset: 2px;
}
.deploy-onchain-btn[hidden] {
	display: none;
}
.deploy-onchain-btn svg {
	width: 1em;
	height: 1em;
}
/* "Deployed ✓" success state — replaces the call-to-action once on-chain. */
.deploy-onchain-btn.is-deployed {
	background: rgba(74, 222, 128, 0.1);
	border-color: rgba(74, 222, 128, 0.42);
	color: #86efac;
}
.deploy-onchain-btn.is-deployed:hover {
	background: rgba(74, 222, 128, 0.2);
	color: #d1fae5;
	border-color: rgba(74, 222, 128, 0.7);
}
@media screen and (max-width: 700px) {
	.deploy-onchain-btn span {
		display: none;
	}
	.deploy-onchain-btn {
		padding: var(--space-xs) var(--space-sm);
	}
}

.view-public-profile-btn {
	display: inline-flex;
	align-items: center;
	gap: var(--space-xs);
	padding: var(--space-sm) var(--space-lg);
	background: rgba(255, 215, 0, 0.1);
	border: 1px solid rgba(255, 215, 0, 0.32);
	border-radius: var(--radius-lg);
	color: rgba(255, 255, 255, 0.9);
	font-family: inherit;
	font-size: var(--text-sm);
	font-weight: 500;
	text-decoration: none;
	cursor: pointer;
	transition: all 0.25s ease;
	letter-spacing: 0.02em;
}
.view-public-profile-btn:hover {
	background: rgba(255, 215, 0, 0.2);
	color: #fff;
	border-color: rgba(255, 215, 0, 0.6);
}
.view-public-profile-btn:focus-visible {
	outline: 2px solid rgba(255, 215, 0, 0.7);
	outline-offset: 2px;
}
.view-public-profile-btn[hidden] {
	display: none;
}
.view-public-profile-btn svg {
	width: 1em;
	height: 1em;
}
@media screen and (max-width: 700px) {
	.view-public-profile-btn span {
		display: none;
	}
	.view-public-profile-btn {
		padding: var(--space-xs) var(--space-sm);
	}
}

/******************************************************************************
 * Avatar Creator Modal
 */

.avatar-creator-overlay {
	position: fixed;
	inset: 0;
	z-index: 100;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, 0.9);
	backdrop-filter: blur(24px);
	-webkit-backdrop-filter: blur(24px);
	animation: avatar-creator-fadein 0.25s ease;
}

@keyframes avatar-creator-fadein {
	from {
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}

.avatar-creator-modal {
	width: 95vw;
	height: 90vh;
	max-width: 1200px;
	display: flex;
	flex-direction: column;
	background: rgba(10, 10, 10, 0.95);
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: var(--radius-lg);
	overflow: hidden;
	box-shadow: 0 16px 64px rgba(0, 0, 0, 0.6);
}

.avatar-creator-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: var(--space-sm) var(--space-lg);
	border-bottom: 1px solid rgba(255, 255, 255, 0.06);
	flex-shrink: 0;
}

.avatar-creator-title {
	font-size: var(--text-lg);
	font-weight: 500;
	color: #fff;
	letter-spacing: 0.03em;
}

.avatar-creator-close {
	background: none;
	border: none;
	color: rgba(255, 255, 255, 0.4);
	font-size: var(--text-2xl);
	cursor: pointer;
	padding: 0;
	line-height: 1;
	transition: color 0.2s ease;
}

.avatar-creator-close:hover {
	color: #fff;
}

.avatar-creator-body {
	flex: 1;
	position: relative;
	min-height: 0;
}

.avatar-creator-container {
	width: 100%;
	height: 100%;
	position: absolute;
	inset: 0;
}

.avatar-creator-iframe {
	width: 100%;
	height: 100%;
	border: none;
}

.avatar-creator-loading {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: var(--space-md);
	color: rgba(255, 255, 255, 0.4);
	font-size: var(--text-sm);
	pointer-events: none;
}

.avatar-creator-loading .spinner {
	position: static;
	margin: 0;
}

.avatar-creator-error {
	color: #f87171;
	font-size: var(--text-sm);
}

@media screen and (max-width: 700px) {
	.avatar-creator-modal {
		width: 100vw;
		height: 100vh;
		max-width: none;
		border-radius: 0;
	}

	.avatar-creator-header {
		padding: var(--space-xs) var(--space-md);
	}
}

/* ============================================================================
   Agent Presence System
   The visual layer that makes agents real — not just JSON.
   ============================================================================ */

/* ── Sidebar layout ────────────────────────────────────────────────────────── */

.agent-presence-sidebar {
	position: fixed;
	top: calc(var(--header-h) + var(--space-md));
	left: var(--space-md);
	width: 220px;
	z-index: 50;
	pointer-events: none;
}

.agent-home-panel {
	background: linear-gradient(180deg, rgba(18, 18, 26, 0.92) 0%, rgba(10, 10, 16, 0.92) 100%);
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: var(--radius-lg);
	backdrop-filter: blur(16px);
	-webkit-backdrop-filter: blur(16px);
	overflow: hidden;
	pointer-events: all;
	display: flex;
	flex-direction: column;
	gap: 0;
	box-shadow:
		0 8px 32px rgba(0, 0, 0, 0.4),
		inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

/* ── Identity card ─────────────────────────────────────────────────────────── */

.agent-home-identity {
	display: flex;
	align-items: center;
	gap: var(--space-sm);
	padding: var(--space-sm) var(--space-sm);
}

.agent-home-avatar-ring {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	border: 2px solid rgba(255, 255, 255, 0.15);
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	transition:
		border-color 0.6s ease,
		box-shadow 0.6s ease;
}

/* Emotion ring colours */
.agent-home-avatar-ring[data-emotion='celebration'] {
	border-color: rgba(134, 239, 172, 0.6);
	box-shadow: 0 0 10px rgba(134, 239, 172, 0.25);
}
.agent-home-avatar-ring[data-emotion='concern'] {
	border-color: rgba(252, 165, 89, 0.6);
	box-shadow: 0 0 10px rgba(252, 165, 89, 0.2);
}
.agent-home-avatar-ring[data-emotion='curiosity'] {
	border-color: rgba(147, 197, 253, 0.6);
	box-shadow: 0 0 10px rgba(147, 197, 253, 0.2);
}
.agent-home-avatar-ring[data-emotion='empathy'] {
	border-color: rgba(216, 180, 254, 0.6);
	box-shadow: 0 0 10px rgba(216, 180, 254, 0.2);
}
.agent-home-avatar-ring[data-emotion='patience'] {
	border-color: rgba(209, 213, 219, 0.4);
}

.agent-home-avatar-inner {
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.06);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 14px;
}

.agent-home-info {
	flex: 1;
	min-width: 0;
}

.agent-home-name-row {
	display: flex;
	align-items: center;
	gap: 5px;
	min-width: 0;
}

.agent-home-name {
	font-family: var(--font-display);
	font-size: var(--text-base);
	font-weight: 600;
	color: #f5f5f7;
	letter-spacing: -0.01em;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* ── Inline-editable fields (name, description) ─────────────────────────── */
.agent-home-editable {
	cursor: text;
	border-radius: 4px;
	padding: 1px 4px;
	margin: -1px -4px;
	transition:
		background 0.15s,
		box-shadow 0.15s;
	outline: none;
}
.agent-home-editable:hover:not(.is-editing) {
	background: rgba(255, 255, 255, 0.04);
}
.agent-home-editable.is-editing,
.agent-home-editable:focus-visible {
	background: rgba(255, 255, 255, 0.08);
	box-shadow: 0 0 0 1px rgba(255, 215, 0, 0.5);
}
.agent-home-editable.is-saving {
	box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18);
	opacity: 0.7;
}
.agent-home-editable.is-saved {
	box-shadow: 0 0 0 1px rgba(74, 222, 128, 0.6);
}
.agent-home-editable.is-error {
	box-shadow: 0 0 0 1px rgba(248, 113, 113, 0.7);
}
/* Empty-state placeholder (no actual <input>, so we render via :before). */
.agent-home-editable:empty:not(.is-editing):before {
	content: attr(data-placeholder);
	color: rgba(255, 255, 255, 0.28);
	font-style: italic;
}

.agent-home-description {
	margin: 4px 0 0;
	font-size: var(--text-xs);
	font-weight: 400;
	color: rgba(255, 255, 255, 0.55);
	line-height: 1.45;
	white-space: normal;
}
.agent-home-description.agent-home-editable {
	cursor: text;
}

.agent-home-status-sep {
	color: rgba(255, 255, 255, 0.2);
	margin: 0 2px;
}

.agent-home-status {
	display: flex;
	align-items: center;
	gap: 5px;
	font-size: var(--text-xs);
	color: rgba(255, 255, 255, 0.4);
	margin-top: 1px;
}

.agent-home-dot {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.3);
	flex-shrink: 0;
}

.agent-home-dot.online {
	background: #4ade80;
	box-shadow: 0 0 4px rgba(74, 222, 128, 0.5);
	animation: agent-dot-pulse 2.5s ease infinite;
}

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

#agent-home-emotion-label {
	transition: opacity 0.15s ease;
}

.agent-home-address {
	font-size: 10px;
	color: rgba(255, 255, 255, 0.35);
	font-family: var(--font-mono);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.agent-home-actions {
	display: flex;
	align-items: center;
	gap: var(--space-xs);
	flex-shrink: 0;
}

.agent-home-btn {
	background: none;
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: var(--radius-sm);
	color: rgba(255, 255, 255, 0.4);
	width: 24px;
	height: 24px;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition:
		color 0.2s,
		border-color 0.2s;
	padding: 0;
	font-size: var(--text-xs);
}

.agent-home-btn:hover {
	color: rgba(255, 255, 255, 0.8);
	border-color: rgba(255, 255, 255, 0.3);
}

.agent-home-badge {
	font-size: 9px;
	padding: 2px 5px;
	border-radius: 999px;
	display: flex;
	align-items: center;
	gap: 3px;
	white-space: nowrap;
}

.agent-home-badge.erc8004 {
	background: rgba(134, 239, 172, 0.12);
	color: #4ade80;
	border: 1px solid rgba(74, 222, 128, 0.25);
	width: 14px;
	height: 14px;
	padding: 0;
	justify-content: center;
	flex-shrink: 0;
}

/* ── Skills (collapsed) ────────────────────────────────────────────────────── */

.agent-home-skills {
	border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.agent-home-skills-summary {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: var(--space-xs) var(--space-sm);
	font-size: 10px;
	color: rgba(255, 255, 255, 0.45);
	cursor: pointer;
	list-style: none;
	user-select: none;
	transition:
		color 0.15s,
		background 0.15s;
}

.agent-home-skills-summary::-webkit-details-marker {
	display: none;
}

.agent-home-skills-summary:hover {
	color: rgba(255, 255, 255, 0.75);
	background: rgba(255, 255, 255, 0.02);
}

.agent-home-skills-label {
	font-weight: 500;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.agent-home-skills-count {
	color: rgba(255, 255, 255, 0.35);
	font-variant-numeric: tabular-nums;
}

.agent-home-chevron {
	margin-left: auto;
	color: rgba(255, 255, 255, 0.3);
	transition: transform 0.2s ease;
}

.agent-home-skills[open] .agent-home-chevron {
	transform: rotate(180deg);
}

.agent-home-skills-strip {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	padding: 0 var(--space-sm) var(--space-xs);
}

.agent-skill-chip {
	font-size: 9px;
	padding: 2px 6px;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.06);
	color: rgba(255, 255, 255, 0.45);
	border: 1px solid rgba(255, 255, 255, 0.08);
	cursor: default;
	transition:
		background 0.15s,
		color 0.15s;
	white-space: nowrap;
}

.agent-skill-chip:hover {
	background: rgba(255, 255, 255, 0.1);
	color: rgba(255, 255, 255, 0.75);
}

/* ── Memory bar ────────────────────────────────────────────────────────────── */

.agent-home-memory-bar {
	display: flex;
	align-items: center;
	gap: var(--space-xs);
	padding: var(--space-xs) var(--space-sm);
	border-top: 1px solid rgba(255, 255, 255, 0.05);
	flex-wrap: wrap;
}

.agent-mem-chip {
	font-size: 9px;
	color: rgba(255, 255, 255, 0.4);
	cursor: default;
}

.agent-mem-total {
	font-size: 9px;
	color: rgba(255, 255, 255, 0.2);
	margin-left: auto;
}

.agent-mem-empty {
	font-size: 9px;
	color: rgba(255, 255, 255, 0.2);
	font-style: italic;
}

/* ── Action timeline ───────────────────────────────────────────────────────── */

.agent-home-timeline {
	max-height: 140px;
	overflow-y: auto;
	border-top: 1px solid rgba(255, 255, 255, 0.05);
	scrollbar-width: thin;
	scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.agent-timeline-empty {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
	padding: var(--space-md) var(--space-sm);
	text-align: center;
}

.agent-timeline-empty-icon {
	color: rgba(139, 92, 246, 0.4);
	margin-bottom: 2px;
}

.agent-timeline-empty-title {
	font-size: 10px;
	font-weight: 500;
	color: rgba(255, 255, 255, 0.55);
	letter-spacing: 0.02em;
}

.agent-timeline-empty-sub {
	font-size: 9px;
	color: rgba(255, 255, 255, 0.3);
	line-height: 1.4;
	max-width: 180px;
}

.agent-timeline-item {
	display: flex;
	align-items: flex-start;
	gap: var(--space-xs);
	padding: 4px var(--space-sm);
	border-bottom: 1px solid rgba(255, 255, 255, 0.03);
	transition: background 0.15s;
}

.agent-timeline-item:hover {
	background: rgba(255, 255, 255, 0.03);
}

.agent-timeline-icon {
	font-size: 10px;
	flex-shrink: 0;
	margin-top: 1px;
	width: 14px;
	text-align: center;
}

.agent-timeline-text {
	font-size: 9px;
	color: rgba(255, 255, 255, 0.5);
	flex: 1;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.agent-timeline-time {
	font-size: 9px;
	color: rgba(255, 255, 255, 0.2);
	flex-shrink: 0;
	white-space: nowrap;
}

@keyframes agent-timeline-in {
	from {
		opacity: 0;
		transform: translateY(-4px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* ── Edit affordance — pencil hint on hover ────────────────────────────────── */

.agent-home-editable:hover:not(.is-editing)::after {
	content: ' ✎';
	font-size: 9px;
	opacity: 0.35;
	pointer-events: none;
}

/* ── Local-save feedback (amber — distinct from green API-saved) ─────────────── */

.agent-home-editable.is-saved-local {
	box-shadow: 0 0 0 1px rgba(251, 191, 36, 0.6);
}

/* ── Char counter ────────────────────────────────────────────────────────────── */

.agent-edit-counter {
	display: none;
	font-size: 9px;
	color: rgba(255, 255, 255, 0.22);
	margin-left: 4px;
	font-variant-numeric: tabular-nums;
	pointer-events: none;
	user-select: none;
	transition: color 0.15s;
}

.agent-edit-counter--visible {
	display: inline;
}

.agent-edit-counter--warn {
	color: rgba(251, 191, 36, 0.6);
}

.agent-edit-counter--over {
	color: rgba(248, 113, 113, 0.8);
}

/* ── Wallet address CTA button ───────────────────────────────────────────────── */

.agent-home-address--cta {
	background: none;
	border: none;
	padding: 0;
	cursor: pointer;
	color: rgba(255, 255, 255, 0.35);
	font-size: 10px;
	font-family: var(--font-mono);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	transition: color 0.15s;
	text-decoration: underline dotted rgba(255, 255, 255, 0.2);
	text-underline-offset: 2px;
}

.agent-home-address--cta:hover {
	color: rgba(251, 191, 36, 0.85);
	text-decoration-color: rgba(251, 191, 36, 0.4);
}

/* ── Connect wallet nudge ────────────────────────────────────────────────────── */

.agent-wallet-nudge {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--space-xs);
	padding: 6px var(--space-sm);
	border-top: 1px solid rgba(255, 255, 255, 0.05);
	opacity: 0;
	transform: translateY(-4px);
	transition:
		opacity 0.25s ease,
		transform 0.25s ease;
}

.agent-wallet-nudge--visible {
	opacity: 1;
	transform: translateY(0);
}

.agent-wallet-nudge-text {
	font-size: 9px;
	color: rgba(255, 255, 255, 0.35);
	line-height: 1.3;
}

.agent-wallet-nudge-btn {
	background: none;
	border: 1px solid rgba(251, 191, 36, 0.35);
	border-radius: 999px;
	color: rgba(251, 191, 36, 0.8);
	font-size: 9px;
	padding: 2px 8px;
	cursor: pointer;
	white-space: nowrap;
	flex-shrink: 0;
	transition:
		background 0.15s,
		color 0.15s,
		border-color 0.15s;
}

.agent-wallet-nudge-btn:hover {
	background: rgba(251, 191, 36, 0.1);
	color: rgba(251, 191, 36, 1);
	border-color: rgba(251, 191, 36, 0.6);
}

/* ── NichAgent updates — emotion dot in header ─────────────────────────────── */

.nich-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: var(--space-sm) var(--space-md);
	border-bottom: 1px solid rgba(255, 255, 255, 0.08);
	background: rgba(255, 255, 255, 0.03);
}

.nich-header-right {
	display: flex;
	align-items: center;
	gap: var(--space-sm);
}

.nich-emotion-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.2);
	transition:
		background 0.4s ease,
		box-shadow 0.4s ease;
}

.nich-toggle-label {
	font-size: 10px;
	margin-top: 3px;
	display: block;
	color: rgba(255, 255, 255, 0.5);
}

.nich-message.status {
	font-size: var(--text-xs);
	color: rgba(255, 255, 255, 0.3);
	font-style: italic;
	padding: 2px var(--space-xs);
}

.nich-message.typing {
	color: rgba(255, 255, 255, 0.4);
	letter-spacing: 2px;
	animation: nich-typing 1.1s ease-in-out infinite;
}

@keyframes nich-typing {
	0%,
	100% {
		opacity: 0.35;
	}
	50% {
		opacity: 0.85;
	}
}

.nich-mic-hint {
	font-size: var(--text-xs);
	color: rgba(255, 255, 255, 0.25);
}

.nich-mic-row {
	display: flex;
	align-items: center;
	gap: var(--space-sm);
	padding: var(--space-xs) var(--space-md);
	border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* ── Responsive — hide sidebar on narrow viewports ─────────────────────────── */

@media screen and (max-width: 900px) {
	.agent-presence-sidebar {
		display: none;
	}
}

/* ── Agent Home standalone page ─────────────────────────────────────────────── */

.agent-home-page {
	min-height: 100vh;
	background: #000;
	color: #e0e0e0;
	font-family: 'Inter', sans-serif;
	display: flex;
	flex-direction: column;
	align-items: center;
	padding: var(--space-2xl) var(--space-md);
}

.agent-home-page-card {
	width: 100%;
	max-width: 480px;
	background: rgba(15, 15, 22, 0.95);
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: 12px;
	overflow: hidden;
}

.agent-home-page-card .agent-home-panel {
	background: transparent;
	border: none;
	border-radius: 0;
}

.agent-home-page-card .agent-home-timeline {
	max-height: 400px;
}

/******************************************************************************
 * Animation Panel (Mixamo-style action selector)
 */

.anim-panel {
	position: absolute;
	bottom: var(--space-lg);
	left: 50%;
	transform: translateX(-50%);
	z-index: 20;
	background: linear-gradient(180deg, rgba(18, 18, 26, 0.92) 0%, rgba(10, 10, 16, 0.92) 100%);
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: var(--radius-lg);
	backdrop-filter: blur(18px);
	-webkit-backdrop-filter: blur(18px);
	padding: var(--space-xs) var(--space-sm);
	max-width: 90vw;
	box-shadow:
		0 8px 32px rgba(0, 0, 0, 0.45),
		inset 0 1px 0 rgba(255, 255, 255, 0.04);
	animation: anim-panel-in 0.3s ease;
}

@keyframes anim-panel-in {
	from {
		opacity: 0;
		transform: translateX(-50%) translateY(12px);
	}
	to {
		opacity: 1;
		transform: translateX(-50%) translateY(0);
	}
}

.anim-panel--empty {
	display: none;
}

.anim-panel__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: var(--space-3xs) var(--space-xs);
	margin-bottom: var(--space-3xs);
}

.anim-panel__title {
	font-size: var(--text-xs);
	color: rgba(255, 255, 255, 0.4);
	font-weight: 500;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.anim-panel__stop {
	background: none;
	border: none;
	color: rgba(255, 255, 255, 0.3);
	font-size: var(--text-sm);
	cursor: pointer;
	padding: 2px 6px;
	border-radius: var(--radius-sm);
	transition:
		color 0.2s,
		background 0.2s;
	line-height: 1;
}

.anim-panel__stop:hover {
	color: #f87171;
	background: rgba(248, 113, 113, 0.1);
}

.anim-panel__grid {
	display: flex;
	gap: var(--space-xs);
	overflow-x: auto;
	scrollbar-width: thin;
	scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
	padding-bottom: 2px;
}

.anim-btn {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 3px;
	padding: var(--space-xs) var(--space-sm);
	min-width: 64px;
	background: rgba(255, 255, 255, 0.04);
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: var(--radius-md);
	color: rgba(255, 255, 255, 0.6);
	font-family: inherit;
	font-size: var(--text-xs);
	cursor: pointer;
	transition: all 0.2s ease;
	flex-shrink: 0;
}

.anim-btn__key {
	position: absolute;
	top: 3px;
	right: 4px;
	font-family: var(--font-mono);
	font-size: 8px;
	font-weight: 600;
	color: rgba(255, 255, 255, 0.25);
	padding: 1px 3px;
	border-radius: 2px;
	background: rgba(255, 255, 255, 0.04);
	line-height: 1;
	pointer-events: none;
	transition:
		color 0.18s,
		background 0.18s;
}

.anim-btn:hover .anim-btn__key {
	color: rgba(255, 255, 255, 0.6);
	background: rgba(255, 255, 255, 0.08);
}

.anim-btn--active .anim-btn__key {
	color: #fff;
	background: rgba(139, 92, 246, 0.35);
}

.anim-btn:hover:not(:disabled) {
	background: rgba(255, 255, 255, 0.1);
	border-color: rgba(255, 255, 255, 0.2);
	color: #fff;
}

.anim-btn--active {
	background: var(--accent-soft);
	border-color: rgba(139, 92, 246, 0.5);
	color: #fff;
	box-shadow: 0 0 16px rgba(139, 92, 246, 0.18);
}

.anim-btn--active:hover {
	background: rgba(139, 92, 246, 0.28);
}

.anim-btn--loading {
	opacity: 0.35;
	cursor: wait;
}

.anim-btn__icon {
	font-size: 1.3rem;
	line-height: 1;
}

.anim-btn__label {
	font-size: 9px;
	font-weight: 500;
	letter-spacing: 0.03em;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: 72px;
}

@media screen and (max-width: 700px) {
	.anim-panel {
		bottom: var(--space-sm);
		padding: var(--space-3xs) var(--space-xs);
		max-width: 95vw;
	}

	.anim-btn {
		min-width: 52px;
		padding: var(--space-3xs) var(--space-xs);
	}

	.anim-btn__icon {
		font-size: 1.1rem;
	}

	.anim-btn__label {
		font-size: 8px;
	}
}

/******************************************************************************
 * Editor — Scene Explorer side panel, Texture Inspector, Texture Lightbox
 * All dark-themed to match the existing viewer chrome.
 */

.scene-explorer {
	position: absolute;
	top: var(--space-sm);
	left: var(--space-sm);
	width: 320px;
	max-height: calc(100% - var(--space-lg));
	background: rgba(20, 20, 28, 0.96);
	color: #e0e0e0;
	border: 1px solid #2a2a36;
	border-radius: var(--radius-md);
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
	display: flex;
	flex-direction: column;
	font-size: var(--text-sm);
	z-index: 40;
	backdrop-filter: blur(8px);
	overflow: hidden;
}
.scene-explorer.hidden {
	display: none;
}

.scene-explorer__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: var(--space-sm) var(--space-md);
	border-bottom: 1px solid #2a2a36;
	background: #0f0f16;
}
.scene-explorer__title {
	font-weight: 600;
	font-size: var(--text-sm);
	letter-spacing: 0.02em;
	text-transform: uppercase;
	color: #b4a4ff;
}
.scene-explorer__close {
	background: none;
	border: none;
	color: #aaa;
	font-size: 18px;
	line-height: 1;
	padding: 2px 8px;
	cursor: pointer;
	border-radius: 4px;
}
.scene-explorer__close:hover {
	background: #2a2a36;
	color: #fff;
}

.scene-explorer__search {
	margin: var(--space-xs) var(--space-sm);
	background: #0b0b12;
	border: 1px solid #2a2a36;
	color: #ddd;
	padding: 6px 10px;
	border-radius: 4px;
	font-size: var(--text-sm);
	outline: none;
}
.scene-explorer__search:focus {
	border-color: #5e4fff;
}

.scene-explorer__hint {
	padding: 2px var(--space-sm) var(--space-xs);
	color: #666;
	font-size: 10px;
	font-family: monospace;
}

.scene-explorer__tree {
	flex: 1;
	overflow-y: auto;
	padding: var(--space-2xs) var(--space-2xs);
	max-height: 40vh;
	border-bottom: 1px solid #2a2a36;
}
.scene-explorer__inspector {
	overflow-y: auto;
	padding: var(--space-sm);
	max-height: 40vh;
	background: #0c0c14;
}
.scene-explorer__empty {
	color: #666;
	font-size: var(--text-xs);
	padding: var(--space-sm);
	text-align: center;
}

.scene-node {
}
.scene-node__row {
	display: flex;
	align-items: center;
	gap: 4px;
	padding: 3px 4px;
	cursor: pointer;
	border-radius: 3px;
	line-height: 1.4;
	user-select: none;
}
.scene-node__row:hover {
	background: #1a1a26;
}
.scene-node__row.selected {
	background: #2a1f5a;
	color: #fff;
}
.scene-node__expander {
	display: inline-block;
	width: 12px;
	color: #888;
	text-align: center;
	font-size: 10px;
	flex-shrink: 0;
}
.scene-node__icon {
	flex-shrink: 0;
	font-size: 12px;
}
.scene-node__label {
	flex: 1;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	font-size: 12px;
}
.scene-node__visibility {
	background: none;
	border: none;
	color: #888;
	font-size: 10px;
	cursor: pointer;
	padding: 0 4px;
	flex-shrink: 0;
}
.scene-node__visibility:hover {
	color: #fff;
}

.scene-node__children {
	display: none;
}
.scene-node__children.open {
	display: block;
}
.scene-node.filtered-out {
	display: none;
}

.inspector__title {
	font-size: var(--text-base);
	font-weight: 600;
	color: #fff;
	margin-bottom: 2px;
}
.inspector__sub {
	color: #666;
	font-size: 10px;
	font-family: monospace;
	margin-bottom: var(--space-xs);
}
.inspector__section {
	margin-top: var(--space-sm);
	margin-bottom: var(--space-2xs);
	font-size: 10px;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: #888;
	border-bottom: 1px solid #22222e;
	padding-bottom: 2px;
}
.inspector__row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--space-xs);
	padding: 2px 0;
	font-size: 11px;
}
.inspector__label {
	color: #888;
	flex-shrink: 0;
	min-width: 40px;
}
.inspector__value {
	color: #ccc;
	font-family: monospace;
	text-align: right;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.vec3-row .vec3 {
	display: flex;
	gap: 2px;
}
.vec3-row input {
	width: 52px;
	background: #0b0b12;
	border: 1px solid #2a2a36;
	color: #ccc;
	padding: 2px 4px;
	border-radius: 3px;
	font-size: 10px;
	font-family: monospace;
	outline: none;
}
.vec3-row input:focus {
	border-color: #5e4fff;
}

.inspector__actions {
	display: flex;
	gap: var(--space-2xs);
	margin-top: var(--space-2xs);
	flex-wrap: wrap;
}
.inspector__actions button {
	background: #22222e;
	border: 1px solid #33334a;
	color: #ccc;
	padding: 4px 8px;
	border-radius: 3px;
	font-size: 10px;
	cursor: pointer;
}
.inspector__actions button:hover {
	background: #2e2e40;
	color: #fff;
}

/* Texture Inspector modal */
.texture-inspector {
	position: fixed;
	top: 80px;
	right: 20px;
	width: min(560px, calc(100vw - 40px));
	max-height: calc(100vh - 100px);
	background: rgba(20, 20, 28, 0.98);
	border: 1px solid #2a2a36;
	border-radius: var(--radius-md);
	box-shadow: 0 15px 60px rgba(0, 0, 0, 0.6);
	display: flex;
	flex-direction: column;
	z-index: 9998;
	color: #e0e0e0;
	overflow: hidden;
}
.texture-inspector__header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: var(--space-sm) var(--space-md);
	border-bottom: 1px solid #2a2a36;
	background: #0f0f16;
}
.texture-inspector__title {
	font-weight: 600;
	font-size: var(--text-sm);
	color: #b4a4ff;
	text-transform: uppercase;
	letter-spacing: 0.02em;
}
.texture-inspector__close {
	background: none;
	border: none;
	color: #aaa;
	font-size: 18px;
	cursor: pointer;
	padding: 2px 8px;
	border-radius: 4px;
}
.texture-inspector__close:hover {
	background: #2a2a36;
	color: #fff;
}

.texture-inspector__grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
	gap: var(--space-sm);
	padding: var(--space-sm);
	overflow-y: auto;
}

.texture-card {
	background: #0c0c14;
	border: 1px solid #22222e;
	border-radius: var(--radius-sm);
	padding: var(--space-xs);
	cursor: pointer;
	transition:
		border-color 0.15s,
		transform 0.15s;
}
.texture-card:hover {
	border-color: #5e4fff;
	transform: translateY(-1px);
}
.texture-card__thumb {
	width: 100%;
	aspect-ratio: 1;
	background: #000
		url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16"><rect width="8" height="8" fill="%23333"/><rect x="8" y="8" width="8" height="8" fill="%23333"/></svg>')
		repeat;
	image-rendering: pixelated;
	border-radius: 3px;
	display: block;
}
.texture-card__info {
	margin-top: var(--space-2xs);
}
.texture-card__name {
	font-size: 11px;
	font-weight: 500;
	color: #ddd;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.texture-card__meta {
	font-size: 10px;
	color: #888;
	font-family: monospace;
}
.texture-card__mats {
	font-size: 10px;
	color: #666;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	margin-top: 2px;
}

/* Texture Lightbox (full preview with channel toggles) */
.texture-lightbox {
	position: fixed;
	inset: 0;
	background: rgba(5, 5, 10, 0.92);
	backdrop-filter: blur(4px);
	z-index: 9999;
	display: flex;
	flex-direction: column;
}
.texture-lightbox__bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: var(--space-sm) var(--space-md);
	background: #0b0b12;
	border-bottom: 1px solid #2a2a36;
	gap: var(--space-md);
	flex-wrap: wrap;
}
.texture-lightbox__meta {
	display: flex;
	flex-direction: column;
	gap: 2px;
}
.texture-lightbox__title {
	font-weight: 600;
	font-size: var(--text-sm);
	color: #fff;
}
.texture-lightbox__dim {
	font-family: monospace;
	font-size: 10px;
	color: #888;
}
.texture-lightbox__channels {
	display: flex;
	gap: 2px;
}
.texture-lightbox__channels button {
	background: #22222e;
	border: 1px solid #33334a;
	color: #aaa;
	padding: 4px 10px;
	border-radius: 3px;
	font-size: 11px;
	font-family: monospace;
	cursor: pointer;
	min-width: 32px;
}
.texture-lightbox__channels button:hover {
	background: #2e2e40;
	color: #fff;
}
.texture-lightbox__channels button.active {
	background: #5e4fff;
	border-color: #7262ff;
	color: #fff;
}
.texture-lightbox__close {
	background: none;
	border: none;
	color: #aaa;
	font-size: 22px;
	cursor: pointer;
	padding: 2px 10px;
	border-radius: 4px;
}
.texture-lightbox__close:hover {
	background: #2a2a36;
	color: #fff;
}
.texture-lightbox__stage {
	flex: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	padding: var(--space-md);
	background:
		linear-gradient(45deg, #1a1a22 25%, transparent 25%),
		linear-gradient(-45deg, #1a1a22 25%, transparent 25%),
		linear-gradient(45deg, transparent 75%, #1a1a22 75%),
		linear-gradient(-45deg, transparent 75%, #1a1a22 75%);
	background-size: 20px 20px;
	background-position:
		0 0,
		0 10px,
		10px -10px,
		10px 0;
	cursor: grab;
}
.texture-lightbox__viewport {
	position: relative;
	max-width: 100%;
	max-height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
}
.texture-lightbox__canvas {
	max-width: min(90vw, 1200px);
	max-height: calc(100vh - 160px);
	object-fit: contain;
	image-rendering: pixelated;
	border: 1px solid #2a2a36;
	background: #000;
	transform-origin: center center;
	transition: none;
}
.texture-lightbox__uv {
	position: absolute;
	inset: 0;
	max-width: min(90vw, 1200px);
	max-height: calc(100vh - 160px);
	object-fit: contain;
	pointer-events: none;
	transform-origin: center center;
}
.texture-lightbox__footer {
	padding: var(--space-xs) var(--space-md);
	background: #0b0b12;
	border-top: 1px solid #2a2a36;
	color: #888;
	font-size: 11px;
	font-family: monospace;
}

@media (max-width: 700px) {
	.scene-explorer {
		width: calc(100vw - var(--space-md));
		max-height: calc(100vh - var(--space-xl));
		top: var(--space-xs);
		left: var(--space-xs);
		right: var(--space-xs);
	}
	.texture-inspector {
		top: var(--space-xs);
		right: var(--space-xs);
		left: var(--space-xs);
		width: auto;
		max-height: calc(100vh - var(--space-lg));
	}
	.texture-lightbox__bar {
		padding: var(--space-xs);
		gap: var(--space-xs);
	}
}

/* ============================================================================
   AUTH GATE — hides power tools from anonymous visitors on the main viewer
   ============================================================================ */

.auth-gate {
	display: none;
}

body[data-viewer-mode='main'][data-authed='pending'] #agent-presence-sidebar,
body[data-viewer-mode='main'][data-authed='pending'] .dg.main {
	visibility: hidden !important;
}

body[data-viewer-mode='main'][data-authed='false'] #agent-presence-sidebar,
body[data-viewer-mode='main'][data-authed='false'] .dg.main {
	display: none !important;
}

body[data-viewer-mode='main'][data-authed='false'] .auth-gate {
	display: block;
	animation: auth-gate-in 0.4s ease;
}

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

.auth-gate {
	position: fixed;
	top: calc(var(--header-h) + var(--space-md));
	left: var(--space-md);
	width: 280px;
	z-index: 50;
}

/* ── First-time onboarding banner ─────────────────────────────────────────── */

.agent-onboarding {
	position: fixed;
	right: var(--space-md);
	bottom: calc(var(--space-md) + 80px);
	width: min(360px, calc(100vw - var(--space-md) * 2));
	z-index: 60;
	animation: agent-onboarding-rise 0.32s ease-out;
}

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

@keyframes agent-onboarding-rise {
	from {
		opacity: 0;
		transform: translateY(12px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.agent-onboarding__inner {
	position: relative;
	background: rgba(12, 12, 18, 0.96);
	border: 1px solid rgba(255, 215, 0, 0.28);
	border-radius: 12px;
	padding: var(--space-lg) var(--space-lg) var(--space-md);
	box-shadow:
		0 12px 36px rgba(0, 0, 0, 0.55),
		0 0 0 1px rgba(255, 215, 0, 0.06);
	color: rgba(255, 255, 255, 0.92);
}

.agent-onboarding__close {
	position: absolute;
	top: 0.4rem;
	right: 0.55rem;
	background: transparent;
	border: 0;
	color: rgba(255, 255, 255, 0.45);
	font-size: 1.4rem;
	line-height: 1;
	cursor: pointer;
	width: 32px;
	height: 32px;
	border-radius: 6px;
	transition:
		color 0.15s,
		background 0.15s;
}

.agent-onboarding__close:hover {
	color: #fff;
	background: rgba(255, 255, 255, 0.06);
}

.agent-onboarding__close:focus-visible {
	outline: 2px solid rgba(255, 215, 0, 0.7);
	outline-offset: 2px;
}

.agent-onboarding__title {
	margin: 0 0 var(--space-xs);
	font-size: 1.05rem;
	font-weight: 500;
	letter-spacing: -0.01em;
}

.agent-onboarding__desc {
	margin: 0 0 var(--space-md);
	font-size: 0.82rem;
	color: rgba(255, 255, 255, 0.62);
	line-height: 1.55;
}

.agent-onboarding__actions {
	display: flex;
	gap: var(--space-sm);
	flex-wrap: wrap;
}

.agent-onboarding__btn {
	display: inline-flex;
	align-items: center;
	padding: 0.5em 0.95em;
	border-radius: 7px;
	font-size: 0.78rem;
	font-weight: 500;
	font-family: inherit;
	text-decoration: none;
	border: 1px solid rgba(255, 255, 255, 0.16);
	background: transparent;
	color: rgba(255, 255, 255, 0.78);
	cursor: pointer;
	transition: all 0.15s;
}

.agent-onboarding__btn:hover {
	color: #fff;
	border-color: rgba(255, 255, 255, 0.36);
	background: rgba(255, 255, 255, 0.04);
}

.agent-onboarding__btn:focus-visible {
	outline: 2px solid rgba(255, 215, 0, 0.7);
	outline-offset: 2px;
}

.agent-onboarding__btn--primary {
	background: rgba(255, 215, 0, 0.92);
	border-color: rgba(255, 215, 0, 0.92);
	color: #000;
}

.agent-onboarding__btn--primary:hover {
	background: #ffd700;
	color: #000;
	border-color: #ffd700;
}

@media (max-width: 700px) {
	.agent-onboarding {
		left: var(--space-md);
		right: var(--space-md);
		bottom: calc(var(--space-md) + 90px);
		width: auto;
	}
}

.auth-gate__inner {
	background: linear-gradient(180deg, rgba(18, 18, 26, 0.94) 0%, rgba(10, 10, 16, 0.94) 100%);
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: var(--radius-lg);
	backdrop-filter: blur(18px);
	-webkit-backdrop-filter: blur(18px);
	padding: var(--space-md);
	box-shadow:
		0 12px 40px rgba(0, 0, 0, 0.5),
		inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.auth-gate__eyebrow {
	display: flex;
	align-items: center;
	gap: var(--space-xs);
	font-size: var(--text-xs);
	color: rgba(255, 255, 255, 0.5);
	font-weight: 500;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	margin-bottom: var(--space-xs);
}

.auth-gate__lock {
	font-size: 1rem;
	opacity: 0.7;
}

.auth-gate__title {
	font-family: 'Space Grotesk', 'Inter', sans-serif;
	font-size: 1.15rem;
	font-weight: 600;
	color: #fff;
	margin: 0 0 var(--space-2xs);
	letter-spacing: -0.01em;
}

.auth-gate__desc {
	font-size: var(--text-sm);
	line-height: 1.5;
	color: rgba(255, 255, 255, 0.65);
	margin: 0 0 var(--space-sm);
}

.auth-gate__actions {
	display: flex;
	flex-direction: column;
	gap: var(--space-2xs);
	margin-bottom: var(--space-sm);
}

.auth-gate__btn {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: var(--space-xs) var(--space-sm);
	border-radius: var(--radius-md);
	font-size: var(--text-sm);
	font-weight: 500;
	text-decoration: none;
	border: 1px solid rgba(255, 255, 255, 0.12);
	color: rgba(255, 255, 255, 0.85);
	background: rgba(255, 255, 255, 0.03);
	transition:
		background 0.15s,
		border-color 0.15s,
		color 0.15s;
}

.auth-gate__btn:hover {
	background: rgba(255, 255, 255, 0.08);
	border-color: rgba(255, 255, 255, 0.2);
	color: #fff;
}

.auth-gate__btn--primary {
	background: #fff;
	color: #0a0a10;
	border-color: #fff;
}

.auth-gate__btn--primary:hover {
	background: rgba(255, 255, 255, 0.9);
	color: #0a0a10;
}

.auth-gate__perks {
	list-style: none;
	padding: 0;
	margin: 0;
	border-top: 1px solid rgba(255, 255, 255, 0.06);
	padding-top: var(--space-sm);
}

.auth-gate__perks li {
	font-size: var(--text-xs);
	color: rgba(255, 255, 255, 0.55);
	padding: var(--space-3xs) 0;
	display: flex;
	align-items: center;
}

.auth-gate__perks li::before {
	content: '→';
	margin-right: var(--space-xs);
	color: rgba(255, 255, 255, 0.4);
}

@media screen and (max-width: 700px) {
	.auth-gate {
		top: auto;
		bottom: var(--space-md);
		left: var(--space-sm);
		right: var(--space-sm);
		width: auto;
	}
}

/******************************************************************************
 * Publish Modal (post-publish share UI — editor "📤 publish as embed")
 */

.publish-overlay {
	position: fixed;
	inset: 0;
	z-index: 120;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, 0.85);
	backdrop-filter: blur(18px);
	-webkit-backdrop-filter: blur(18px);
	animation: publish-fadein 0.2s ease;
}

@keyframes publish-fadein {
	from {
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}

.publish-modal {
	width: 92vw;
	max-width: 560px;
	max-height: 85vh;
	display: flex;
	flex-direction: column;
	background: rgba(10, 10, 10, 0.96);
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: var(--radius-lg);
	overflow: hidden;
	box-shadow: 0 16px 64px rgba(0, 0, 0, 0.6);
	color: #e0e0e0;
}

.publish-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: var(--space-sm) var(--space-lg);
	border-bottom: 1px solid rgba(255, 255, 255, 0.06);
	flex-shrink: 0;
}

.publish-title {
	font-size: var(--text-lg);
	font-weight: 500;
	color: #fff;
	letter-spacing: 0.03em;
}

.publish-close {
	background: none;
	border: none;
	color: rgba(255, 255, 255, 0.4);
	font-size: var(--text-2xl);
	cursor: pointer;
	padding: 0;
	line-height: 1;
	transition: color 0.2s ease;
}

.publish-close:hover {
	color: #fff;
}

.publish-body {
	padding: var(--space-lg);
	overflow-y: auto;
	flex: 1;
	min-height: 0;
}

/* ── Progress steps ──────────────────────────────────────────────────────── */

.publish-steps {
	display: flex;
	flex-direction: column;
	gap: var(--space-xs);
}

.publish-step {
	display: flex;
	align-items: center;
	gap: var(--space-sm);
	padding: var(--space-xs) var(--space-sm);
	border-radius: var(--radius-md);
	font-size: var(--text-sm);
	color: rgba(255, 255, 255, 0.5);
	transition:
		color 0.2s ease,
		background 0.2s ease;
}

.publish-step--active {
	color: #fff;
	background: var(--accent-soft);
}

.publish-step--done {
	color: rgba(255, 255, 255, 0.85);
}

.publish-step-dot {
	width: 18px;
	height: 18px;
	border-radius: 50%;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 12px;
	line-height: 1;
	flex-shrink: 0;
	border: 1px solid rgba(255, 255, 255, 0.2);
	background: transparent;
	color: inherit;
	box-sizing: border-box;
}

.publish-step--done .publish-step-dot {
	background: var(--accent);
	border-color: var(--accent);
	color: #fff;
}

.publish-step--active .publish-step-dot {
	border-color: var(--accent);
	border-top-color: transparent;
	animation: publish-spin 0.9s linear infinite;
}

@keyframes publish-spin {
	from {
		transform: rotate(0deg);
	}
	to {
		transform: rotate(360deg);
	}
}

/* ── Result state (snippets) ─────────────────────────────────────────────── */

.publish-result {
	display: flex;
	flex-direction: column;
	gap: var(--space-md);
}

.publish-snippet {
	display: flex;
	flex-direction: column;
	gap: var(--space-2xs);
}

.publish-snippet-label {
	font-size: var(--text-sm);
	color: rgba(255, 255, 255, 0.55);
	letter-spacing: 0.02em;
}

.publish-snippet-row {
	display: flex;
	gap: var(--space-xs);
	align-items: stretch;
	min-width: 0;
}

.publish-snippet-value {
	flex: 1;
	min-width: 0;
	margin: 0;
	padding: var(--space-xs) var(--space-sm);
	background: rgba(255, 255, 255, 0.04);
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: var(--radius-md);
	color: #e0e0e0;
	font-family: var(--font-mono);
	font-size: var(--text-sm);
	overflow-x: auto;
	white-space: pre;
	line-height: var(--leading-tight);
}

.publish-snippet-value:focus {
	outline: 2px solid var(--accent);
	outline-offset: 1px;
}

.publish-snippet-actions {
	display: flex;
	gap: var(--space-2xs);
	flex-shrink: 0;
}

.publish-copy-btn,
.publish-open-btn {
	background: rgba(255, 255, 255, 0.06);
	border: 1px solid rgba(255, 255, 255, 0.1);
	color: #e0e0e0;
	padding: 0 var(--space-sm);
	border-radius: var(--radius-md);
	font-size: var(--text-sm);
	cursor: pointer;
	white-space: nowrap;
	transition:
		background 0.15s ease,
		color 0.15s ease;
}

.publish-copy-btn:hover,
.publish-open-btn:hover {
	background: var(--accent-soft);
	color: #fff;
}

.publish-copy-btn:disabled {
	color: var(--accent);
	background: var(--accent-soft);
	cursor: default;
}

/* ── Action rows (Done / Sign in / Retry / Cancel) ──────────────────────── */

.publish-actions {
	display: flex;
	justify-content: flex-end;
	gap: var(--space-sm);
	margin-top: var(--space-sm);
}

.publish-done-btn,
.publish-signin-btn,
.publish-retry-btn,
.publish-cancel-btn {
	background: rgba(255, 255, 255, 0.06);
	border: 1px solid rgba(255, 255, 255, 0.1);
	color: #e0e0e0;
	padding: var(--space-xs) var(--space-md);
	border-radius: var(--radius-md);
	font-size: var(--text-sm);
	cursor: pointer;
	transition:
		background 0.15s ease,
		color 0.15s ease,
		filter 0.15s ease;
}

.publish-done-btn,
.publish-signin-btn,
.publish-retry-btn {
	background: var(--accent);
	color: #fff;
	border-color: var(--accent);
}

.publish-done-btn:hover,
.publish-signin-btn:hover,
.publish-retry-btn:hover {
	filter: brightness(1.12);
}

.publish-cancel-btn:hover {
	background: var(--accent-soft);
	color: #fff;
}

/* ── Auth-required + error states ────────────────────────────────────────── */

.publish-auth-msg {
	margin: 0 0 var(--space-md);
	color: rgba(255, 255, 255, 0.7);
	font-size: var(--text-sm);
	line-height: var(--leading-normal);
}

.publish-error-name {
	font-family: var(--font-mono);
	font-size: var(--text-sm);
	color: #f87171;
	margin-bottom: var(--space-xs);
}

.publish-error-message {
	font-size: var(--text-sm);
	color: rgba(255, 255, 255, 0.7);
	line-height: var(--leading-normal);
	margin-bottom: var(--space-md);
	word-break: break-word;
}

@media screen and (max-width: 700px) {
	.publish-modal {
		width: 100vw;
		max-width: none;
		max-height: 100vh;
		border-radius: 0;
	}
	.publish-snippet-row {
		flex-direction: column;
	}
	.publish-snippet-actions {
		justify-content: flex-end;
	}
}

/******************************************************************************
 * ERC-8004 Agent Studio — parity additions (hero, mainnet banner,
 * filter chips, batch tab, QR modal, export accordion, footer).
 */

.erc8004-shell {
	width: 100%;
	max-width: 960px;
	margin: 0 auto;
}

.erc8004-hero {
	margin-bottom: var(--space-md);
}

.erc8004-hero-topbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--space-md);
	margin-bottom: var(--space-lg);
	flex-wrap: wrap;
}

.erc8004-hero-body {
	text-align: center;
	padding: var(--space-lg) 0;
}

.erc8004-hero-badge {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 6px 14px;
	border-radius: 20px;
	background: rgba(99, 102, 241, 0.15);
	border: 1px solid rgba(139, 92, 246, 0.35);
	color: #a5b4fc;
	font-size: 12px;
	font-weight: 500;
	margin-bottom: var(--space-md);
}

.erc8004-hero-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #22c55e;
	box-shadow: 0 0 8px #22c55e;
}

.erc8004-hero-h1 {
	margin: 0 0 var(--space-sm);
	font-size: clamp(28px, 5vw, 44px);
	line-height: 1.1;
	font-weight: 600;
	color: #fff;
	letter-spacing: -0.02em;
}

.erc8004-hero-accent {
	background: linear-gradient(90deg, #6366f1, #a78bfa);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
}

.erc8004-hero-sub {
	max-width: 620px;
	margin: 0 auto var(--space-md);
	color: rgba(255, 255, 255, 0.55);
	font-size: var(--text-base);
	line-height: 1.6;
}

.erc8004-hero .erc8004-stats {
	max-width: 540px;
	margin: 0 auto;
}

.erc8004-mainnet-banner {
	padding: var(--space-sm) var(--space-md);
	margin-bottom: var(--space-md);
	background: rgba(239, 68, 68, 0.1);
	border: 1px solid rgba(239, 68, 68, 0.4);
	border-radius: var(--radius-md);
	color: #fca5a5;
	font-size: var(--text-sm);
	text-align: center;
}

/* Filter chips */
.erc8004-filter-chips {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
	margin: var(--space-sm) 0;
}

.erc8004-chip {
	padding: 6px 14px;
	border-radius: 20px;
	font-size: 12px;
	font-weight: 500;
	background: rgba(255, 255, 255, 0.04);
	border: 1px solid rgba(255, 255, 255, 0.1);
	color: rgba(255, 255, 255, 0.6);
	cursor: pointer;
	font-family: inherit;
	transition: all 0.2s;
}

.erc8004-chip:hover {
	border-color: rgba(99, 102, 241, 0.5);
}

.erc8004-chip--active {
	background: rgba(99, 102, 241, 0.15);
	border-color: rgba(99, 102, 241, 0.5);
	color: #a5b4fc;
}

.erc8004-tag--x402 {
	background: rgba(124, 58, 237, 0.2);
	color: #c4b5fd;
	border-color: rgba(124, 58, 237, 0.4);
}

.erc8004-tag--owner {
	background: var(--accent-soft);
	color: var(--accent);
	border-color: var(--accent);
}

/* Batch tab */
.erc8004-batch-drop {
	height: 140px;
	margin: var(--space-md) 0;
}

.erc8004-batch-drop-inner {
	pointer-events: none;
	text-align: center;
}

.erc8004-batch-drop-icon {
	font-size: 32px;
	margin-bottom: 8px;
}

.erc8004-batch-drop-title {
	font-weight: 600;
	color: rgba(255, 255, 255, 0.8);
	margin-bottom: 4px;
}

.erc8004-batch-drop-sub {
	font-size: 13px;
	color: rgba(255, 255, 255, 0.45);
}

.erc8004-batch-preview {
	margin-top: var(--space-md);
}

.erc8004-batch-list {
	max-height: 380px;
	overflow-y: auto;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.erc8004-batch-row {
	display: grid;
	grid-template-columns: auto 1fr auto;
	gap: 12px;
	align-items: center;
	padding: 8px 12px;
	background: rgba(255, 255, 255, 0.03);
	border: 1px solid rgba(255, 255, 255, 0.06);
	border-radius: var(--radius-sm);
}

.erc8004-batch-row-num {
	width: 24px;
	height: 24px;
	border-radius: 50%;
	background: rgba(99, 102, 241, 0.2);
	color: #a5b4fc;
	font-size: 12px;
	font-weight: 600;
	display: flex;
	align-items: center;
	justify-content: center;
}

.erc8004-batch-row-title {
	font-weight: 500;
	color: #fff;
}

.erc8004-batch-row-status {
	font-size: 12px;
}

.erc8004-batch-progress {
	margin-top: var(--space-md);
}

.erc8004-progress-bar {
	height: 6px;
	background: rgba(255, 255, 255, 0.08);
	border-radius: 3px;
	overflow: hidden;
	margin-bottom: 6px;
}

.erc8004-progress-fill {
	height: 100%;
	background: linear-gradient(90deg, #6366f1, #a78bfa);
	transition: width 0.3s;
	width: 0;
}

.erc8004-pre {
	font-family: monospace;
	font-size: 12px;
	background: rgba(0, 0, 0, 0.3);
	border: 1px solid rgba(255, 255, 255, 0.06);
	border-radius: var(--radius-sm);
	padding: 10px 12px;
	color: rgba(255, 255, 255, 0.7);
	white-space: pre-wrap;
	overflow-x: auto;
}

/* Step 3 — avatar source picker */
.erc8004-avatar-sources {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: var(--space-xs);
	margin: var(--space-sm) 0 var(--space-md);
}

@media (max-width: 640px) {
	.erc8004-avatar-sources {
		grid-template-columns: 1fr;
	}
}

.erc8004-avatar-source {
	display: flex;
	align-items: flex-start;
	gap: var(--space-xs);
	padding: var(--space-sm);
	background: rgba(255, 255, 255, 0.02);
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: var(--radius-md);
	cursor: pointer;
	transition:
		border-color 0.15s,
		background 0.15s;
}

.erc8004-avatar-source:hover {
	border-color: rgba(255, 255, 255, 0.18);
}

.erc8004-avatar-source--active {
	border-color: var(--accent);
	background: var(--accent-soft);
}

.erc8004-avatar-source--disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.erc8004-avatar-source input[type='radio'] {
	margin-top: 3px;
	accent-color: var(--accent);
}

.erc8004-avatar-source-title {
	font-size: var(--text-sm);
	font-weight: 500;
	color: #fff;
}

.erc8004-avatar-source-hint {
	margin-top: 2px;
	font-size: var(--text-xs);
	color: rgba(255, 255, 255, 0.45);
}

.erc8004-avatar-source-hint code {
	font-family: var(--font-mono);
	font-size: 0.92em;
	color: rgba(255, 255, 255, 0.6);
	word-break: break-all;
}

.erc8004-avatar-panel {
	margin-bottom: var(--space-md);
}

.erc8004-avatar-summary {
	display: flex;
	align-items: flex-start;
	gap: var(--space-sm);
	padding: var(--space-sm) var(--space-md);
	background: rgba(139, 92, 246, 0.08);
	border: 1px solid rgba(139, 92, 246, 0.25);
	border-radius: var(--radius-md);
	font-size: var(--text-sm);
	color: #fff;
}

.erc8004-avatar-summary code {
	font-family: var(--font-mono);
	font-size: 0.9em;
	word-break: break-all;
}

.erc8004-avatar-summary-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	background: var(--accent);
	color: #fff;
	font-size: var(--text-xs);
	font-weight: 700;
	flex-shrink: 0;
}

.erc8004-avatar-summary-badge--muted {
	background: rgba(255, 255, 255, 0.12);
	color: rgba(255, 255, 255, 0.55);
}

.erc8004-saved-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
	gap: var(--space-xs);
	padding: var(--space-sm);
	background: rgba(255, 255, 255, 0.02);
	border: 1px solid rgba(255, 255, 255, 0.06);
	border-radius: var(--radius-md);
	min-height: 120px;
}

.erc8004-saved-card {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 4px;
	padding: 4px;
	background: rgba(255, 255, 255, 0.04);
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: var(--radius-sm);
	cursor: pointer;
	text-align: left;
	color: inherit;
	font-family: inherit;
	transition:
		border-color 0.15s,
		background 0.15s;
}

.erc8004-saved-card:hover {
	border-color: rgba(255, 255, 255, 0.25);
}

.erc8004-saved-card--active {
	border-color: var(--accent);
	background: var(--accent-soft);
}

.erc8004-saved-card img,
.erc8004-saved-card-ph {
	width: 100%;
	aspect-ratio: 1 / 1;
	object-fit: cover;
	border-radius: var(--radius-sm);
	background: rgba(255, 255, 255, 0.04);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: var(--text-xs);
	color: rgba(255, 255, 255, 0.4);
	font-weight: 600;
	letter-spacing: 0.08em;
}

.erc8004-saved-card-name {
	font-size: var(--text-xs);
	color: rgba(255, 255, 255, 0.8);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	padding: 0 2px 2px;
}

/* Accordion */
.erc8004-accordion {
	margin-top: var(--space-md);
	background: rgba(255, 255, 255, 0.03);
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: var(--radius-md);
	overflow: hidden;
}

.erc8004-accordion-head {
	cursor: pointer;
	list-style: none;
	padding: 12px 14px;
	font-weight: 500;
	color: rgba(255, 255, 255, 0.8);
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.erc8004-accordion-head::after {
	content: '▼';
	color: rgba(255, 255, 255, 0.4);
	font-size: 10px;
	transition: transform 0.2s;
}

.erc8004-accordion[open] .erc8004-accordion-head::after {
	transform: rotate(180deg);
}

.erc8004-accordion-head::-webkit-details-marker {
	display: none;
}

.erc8004-accordion-body {
	padding: 0 14px 14px;
	border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Export options grid */
.erc8004-export-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
	gap: 8px;
	margin-top: 12px;
}

.erc8004-export-opt {
	padding: 14px;
	background: rgba(255, 255, 255, 0.04);
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: var(--radius-sm);
	color: #fff;
	font-family: inherit;
	cursor: pointer;
	text-align: center;
	transition: all 0.2s;
}

.erc8004-export-opt:hover {
	background: rgba(99, 102, 241, 0.1);
	border-color: rgba(139, 92, 246, 0.35);
}

.erc8004-export-emoji {
	font-size: 22px;
	margin-bottom: 6px;
}

.erc8004-export-title {
	font-size: 13px;
	font-weight: 600;
	margin-bottom: 2px;
}

.erc8004-export-sub {
	font-size: 11px;
	color: rgba(255, 255, 255, 0.45);
}

/* QR modal */
.erc8004-modal {
	position: fixed;
	inset: 0;
	z-index: 600;
	background: rgba(0, 0, 0, 0.7);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: var(--space-md);
}

.erc8004-modal-card {
	background: #0d0d12;
	border: 1px solid rgba(255, 255, 255, 0.12);
	border-radius: var(--radius-lg);
	padding: var(--space-lg);
	max-width: 420px;
	width: 100%;
	text-align: center;
}

.erc8004-modal-head {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: var(--space-sm);
}

.erc8004-checkbox {
	display: flex;
	align-items: center;
	gap: var(--space-sm);
	margin-bottom: var(--space-md);
	font-size: var(--text-sm);
	color: rgba(255, 255, 255, 0.75);
	cursor: pointer;
	user-select: none;
}

.erc8004-checkbox input[type='checkbox'] {
	width: 16px;
	height: 16px;
	accent-color: #b15bff;
	cursor: pointer;
}

.erc8004-qr-canvas-wrap {
	display: flex;
	justify-content: center;
	background: #fff;
	border-radius: var(--radius-sm);
	padding: 12px;
	margin: var(--space-sm) 0;
}

.erc8004-qr-canvas-wrap canvas {
	max-width: 100%;
	height: auto;
	image-rendering: pixelated;
}

.erc8004-qr-url {
	word-break: break-all;
	margin: 0 0 var(--space-sm);
}

/* Embed snippet modal */
.erc8004-embed-tabs {
	display: flex;
	gap: 2px;
	margin: var(--space-md) 0 0;
	border-bottom: 1px solid rgba(255, 255, 255, 0.1);
	padding: 0;
	flex-wrap: wrap;
}
.erc8004-embed-tabs .erc8004-tab {
	padding: 8px 14px;
	background: transparent;
	border: 0;
	border-bottom: 2px solid transparent;
	color: rgba(255, 255, 255, 0.55);
	font-size: var(--text-sm);
	cursor: pointer;
	transition:
		color 0.15s,
		border-color 0.15s;
}
.erc8004-embed-tabs .erc8004-tab:hover {
	color: rgba(255, 255, 255, 0.9);
}
.erc8004-embed-tabs .erc8004-tab.is-active {
	color: #fff;
	border-bottom-color: var(--accent, #8b5cf6);
}
.erc8004-embed-panels {
	padding: var(--space-md) 0;
}
.erc8004-embed-panels > [data-panel] {
	display: flex;
	flex-direction: column;
	gap: var(--space-sm);
}
.erc8004-embed-panels > [data-panel][hidden] {
	display: none;
}
.erc8004-code {
	width: 100%;
	box-sizing: border-box;
	background: rgba(0, 0, 0, 0.4);
	color: #e5e7eb;
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: var(--radius-sm);
	padding: 10px 12px;
	font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
	font-size: 12px;
	line-height: 1.5;
	resize: vertical;
	user-select: all;
	white-space: pre;
	overflow-x: auto;
}
textarea.erc8004-code {
	min-height: 48px;
}
.erc8004-embed-policy {
	margin-top: var(--space-md);
	padding-top: var(--space-md);
	border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.erc8004-embed-policy summary {
	cursor: pointer;
	color: rgba(255, 255, 255, 0.65);
	font-size: var(--text-sm);
	margin-bottom: var(--space-sm);
}
.erc8004-embed-policy summary:hover {
	color: #fff;
}

/* Footer */
.erc8004-footer {
	margin-top: var(--space-lg);
	padding: var(--space-lg) 0;
	text-align: center;
	color: rgba(255, 255, 255, 0.45);
	font-size: var(--text-sm);
}

.erc8004-footer-links {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: var(--space-md);
	margin-bottom: var(--space-md);
}

.erc8004-footer-links a {
	color: rgba(255, 255, 255, 0.6);
	text-decoration: none;
}

.erc8004-footer-links a:hover {
	color: #fff;
}

.erc8004-footer-cols {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
	gap: var(--space-lg);
	max-width: 800px;
	margin: 0 auto var(--space-md);
	padding: var(--space-md) 0;
	border-top: 1px solid rgba(255, 255, 255, 0.08);
	border-bottom: 1px solid rgba(255, 255, 255, 0.08);
	text-align: left;
}

.erc8004-footer-col {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.erc8004-footer-title {
	font-weight: 600;
	color: rgba(255, 255, 255, 0.8);
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: 1px;
	margin-bottom: 4px;
}

.erc8004-footer-col a {
	color: rgba(255, 255, 255, 0.55);
	text-decoration: none;
	font-size: 13px;
}

.erc8004-footer-col a:hover {
	color: #fff;
}

.erc8004-footer-credit {
	margin: 0;
	font-size: 12px;
	color: rgba(255, 255, 255, 0.35);
}

.erc8004-footer-credit a {
	color: rgba(255, 255, 255, 0.55);
}

/* ─────────────────────────────────────────────────────────────────────────
 * /discover — ERC-8004 agent marketplace
 * Lobehub-plugin-grid × etherscan-NFT-detail hybrid. Uses site tokens.
 * ───────────────────────────────────────────────────────────────────────── */

.explore-main {
	max-width: 1280px;
	margin: 0 auto;
	padding: var(--space-xl) var(--space-lg);
}

.explore-hero {
	text-align: center;
	padding: var(--space-2xl) 0 var(--space-xl);
}
.explore-hero h2 {
	font-family: 'Space Grotesk', system-ui, sans-serif;
	font-size: clamp(2rem, 4vw, 3.2rem);
	font-weight: 700;
	letter-spacing: -0.02em;
	margin: var(--space-md) 0 var(--space-sm);
	color: #fff;
}
.explore-sub {
	max-width: 560px;
	margin: 0 auto;
	color: rgba(255, 255, 255, 0.6);
	font-size: 15px;
	line-height: 1.55;
}
.explore-hero-chips {
	display: inline-flex;
	flex-wrap: wrap;
	gap: 10px;
	justify-content: center;
}
.explore-hero-chip {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 6px 14px;
	background: var(--accent-soft);
	border: 1px solid var(--accent);
	border-radius: 99px;
	color: var(--accent);
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.02em;
	text-transform: uppercase;
}
.explore-hero-chip--link {
	text-decoration: none;
	background: transparent;
	border-color: rgba(255, 255, 255, 0.18);
	color: rgba(255, 255, 255, 0.78);
	transition:
		border-color 0.15s ease,
		color 0.15s ease,
		background 0.15s ease;
}
.explore-hero-chip--link:hover,
.explore-hero-chip--link:focus-visible {
	border-color: var(--accent);
	color: var(--accent);
	background: var(--accent-soft);
}
.explore-hero-dot {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--accent);
	box-shadow: 0 0 10px var(--accent);
}

.explore-stats {
	display: flex;
	justify-content: center;
	gap: var(--space-xl);
	margin-top: var(--space-xl);
	flex-wrap: wrap;
}
.explore-stat {
	text-align: center;
}
.explore-stat-value {
	font-family: 'Space Grotesk', system-ui, sans-serif;
	font-size: 28px;
	font-weight: 700;
	color: var(--accent);
}
.explore-stat-label {
	font-size: 11px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: rgba(255, 255, 255, 0.45);
	margin-top: 2px;
}

.explore-controls {
	display: flex;
	gap: var(--space-md);
	align-items: center;
	flex-wrap: wrap;
	margin: var(--space-xl) 0 var(--space-lg);
	padding: var(--space-md);
	background: rgba(255, 255, 255, 0.02);
	border: 1px solid rgba(255, 255, 255, 0.06);
	border-radius: var(--radius-md);
}
.explore-search {
	flex: 1 1 260px;
	position: relative;
}
.explore-search input {
	width: 100%;
	padding: 10px 36px 10px 14px;
	background: rgba(0, 0, 0, 0.4);
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: var(--radius-sm);
	color: #fff;
	font: inherit;
	font-size: 14px;
}
.explore-search input:focus {
	outline: none;
	border-color: var(--accent);
	background: rgba(0, 0, 0, 0.6);
}
/* Hide native WebKit clear; we render our own. */
.explore-search input[type='search']::-webkit-search-cancel-button {
	-webkit-appearance: none;
	appearance: none;
}
.explore-search-clear {
	position: absolute;
	top: 50%;
	right: 8px;
	transform: translateY(-50%);
	width: 22px;
	height: 22px;
	display: grid;
	place-items: center;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.1);
	color: rgba(255, 255, 255, 0.7);
	font-size: 16px;
	line-height: 1;
	cursor: pointer;
	transition:
		background 0.15s ease,
		color 0.15s ease;
}
.explore-search-clear:hover,
.explore-search-clear:focus-visible {
	background: var(--accent-soft);
	color: var(--accent);
	outline: none;
}
.explore-chips {
	display: flex;
	gap: 6px;
}
.explore-chip {
	padding: 8px 14px;
	background: transparent;
	border: 1px solid rgba(255, 255, 255, 0.12);
	border-radius: var(--radius-sm);
	color: rgba(255, 255, 255, 0.6);
	font: inherit;
	font-size: 13px;
	font-weight: 500;
	cursor: pointer;
	transition: all 0.15s;
}
.explore-chip:hover {
	border-color: rgba(255, 255, 255, 0.25);
	color: #fff;
}
.explore-chip.active {
	background: var(--accent-soft);
	border-color: var(--accent);
	color: var(--accent);
}
.explore-chain-select {
	display: flex;
	align-items: center;
	gap: 8px;
	color: rgba(255, 255, 255, 0.55);
	font-size: 13px;
}
.explore-chain-select select {
	padding: 8px 10px;
	background: rgba(0, 0, 0, 0.4);
	border: 1px solid rgba(255, 255, 255, 0.12);
	border-radius: var(--radius-sm);
	color: #fff;
	font: inherit;
	font-size: 13px;
}

.explore-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	gap: var(--space-md);
}

.explore-card {
	background: rgba(255, 255, 255, 0.025);
	border: 1px solid rgba(255, 255, 255, 0.06);
	border-radius: var(--radius-md);
	overflow: hidden;
	transition:
		border-color 0.15s,
		transform 0.15s,
		background 0.15s;
	display: flex;
	flex-direction: column;
}
.explore-card:hover {
	border-color: rgba(255, 255, 255, 0.18);
	transform: translateY(-2px);
	background: rgba(255, 255, 255, 0.04);
}
.explore-card--3d:hover {
	border-color: var(--accent);
}

.explore-card-thumb {
	position: relative;
	display: block;
	aspect-ratio: 1 / 1;
	background: linear-gradient(135deg, #111 0%, #1a1a1f 100%);
	overflow: hidden;
	text-decoration: none;
}
.explore-card-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}
.explore-card-ph {
	display: grid;
	place-items: center;
	height: 100%;
	font-size: 48px;
	opacity: 0.4;
}
.explore-card-play {
	position: absolute;
	inset: 0;
	display: grid;
	place-items: center;
	font-size: 34px;
	color: #fff;
	text-shadow: 0 2px 14px rgba(0, 0, 0, 0.6);
	opacity: 0;
	background: rgba(0, 0, 0, 0.35);
	transition: opacity 0.2s;
}
.explore-card--3d:hover .explore-card-play {
	opacity: 1;
}

.explore-card-body {
	padding: var(--space-md);
	display: flex;
	flex-direction: column;
	gap: 8px;
	flex: 1;
}
.explore-card-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 8px;
}
.explore-card-name {
	margin: 0;
	font-family: 'Space Grotesk', system-ui, sans-serif;
	font-size: 15px;
	font-weight: 600;
	color: #fff;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.explore-card-id {
	font-size: 11px;
	color: rgba(255, 255, 255, 0.35);
	font-family:
		ui-monospace,
		SF Mono,
		Menlo,
		monospace;
	flex-shrink: 0;
}
.explore-card-badges {
	display: flex;
	gap: 4px;
	flex-wrap: wrap;
}
.explore-badge {
	font-size: 10px;
	padding: 2px 7px;
	border-radius: 99px;
	font-weight: 600;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	background: rgba(255, 255, 255, 0.06);
	color: rgba(255, 255, 255, 0.7);
	border: 1px solid rgba(255, 255, 255, 0.08);
}
.explore-badge--3d {
	background: var(--accent-soft);
	color: var(--accent);
	border-color: var(--accent);
}
.explore-badge--x402 {
	background: rgba(124, 58, 237, 0.2);
	color: #c4b5fd;
	border-color: rgba(124, 58, 237, 0.4);
}
.explore-card-desc {
	margin: 0;
	font-size: 13px;
	color: rgba(255, 255, 255, 0.55);
	line-height: 1.45;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.explore-card-svcs {
	display: flex;
	gap: 4px;
	flex-wrap: wrap;
}
.explore-svc {
	font-size: 10px;
	padding: 2px 6px;
	background: rgba(255, 255, 255, 0.04);
	color: rgba(255, 255, 255, 0.55);
	border-radius: 4px;
	font-family:
		ui-monospace,
		SF Mono,
		Menlo,
		monospace;
	text-transform: uppercase;
	letter-spacing: 0.03em;
}
.explore-card-foot {
	margin-top: auto;
	padding-top: 8px;
	display: flex;
	justify-content: space-between;
	align-items: center;
	border-top: 1px solid rgba(255, 255, 255, 0.05);
	gap: 8px;
}
.explore-card-owner {
	font-size: 11px;
	font-family:
		ui-monospace,
		SF Mono,
		Menlo,
		monospace;
	color: rgba(255, 255, 255, 0.4);
	text-decoration: none;
}
.explore-card-owner:hover {
	color: var(--accent);
}
.explore-card-actions {
	display: flex;
	gap: 10px;
}
.explore-card-link {
	font-size: 12px;
	color: rgba(255, 255, 255, 0.7);
	text-decoration: none;
	font-weight: 500;
}
.explore-card-link:hover {
	color: var(--accent);
}

.explore-status {
	text-align: center;
	padding: var(--space-lg) 0;
	color: rgba(255, 255, 255, 0.4);
	font-size: 13px;
}
.explore-empty {
	padding: var(--space-xl);
	border: 1px dashed rgba(255, 255, 255, 0.1);
	border-radius: var(--radius-md);
	color: rgba(255, 255, 255, 0.5);
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 14px;
}
.explore-clear-filters {
	background: transparent;
	border: 1px solid rgba(255, 255, 255, 0.18);
	color: rgba(255, 255, 255, 0.78);
	padding: 7px 16px;
	border-radius: 99px;
	font-size: 13px;
	font-weight: 500;
	cursor: pointer;
	transition:
		border-color 0.15s ease,
		color 0.15s ease,
		background 0.15s ease;
}
.explore-clear-filters:hover,
.explore-clear-filters:focus-visible {
	border-color: var(--accent);
	color: var(--accent);
	background: var(--accent-soft);
}
.explore-error {
	padding: var(--space-md);
	background: rgba(239, 68, 68, 0.08);
	border: 1px solid rgba(239, 68, 68, 0.3);
	border-radius: var(--radius-sm);
	color: #fca5a5;
}

.explore-load-more-wrap {
	display: flex;
	justify-content: center;
	padding: var(--space-lg) 0;
}
.explore-load-more {
	padding: 10px 24px;
	background: var(--accent-soft);
	border: 1px solid var(--accent);
	border-radius: var(--radius-sm);
	color: var(--accent);
	font: inherit;
	font-weight: 600;
	font-size: 14px;
	cursor: pointer;
	transition: all 0.15s;
}
.explore-load-more:hover {
	background: var(--accent);
	color: #fff;
}

/* ─────────────────────────────────────────────────────────────────────────
   Embed modal — shared by /discover + Search tab
   ─────────────────────────────────────────────────────────────────────── */
.embed-modal {
	position: fixed;
	inset: 0;
	z-index: 9999;
	display: grid;
	place-items: center;
	padding: 16px;
	animation: embed-modal-in 0.18s ease-out;
}
@keyframes embed-modal-in {
	from {
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}
.embed-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.6);
	backdrop-filter: blur(6px);
}
.embed-modal__panel {
	position: relative;
	width: min(640px, 100%);
	max-height: calc(100vh - 32px);
	background: #0f1115;
	color: #e5e5e5;
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: 16px;
	box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
	display: flex;
	flex-direction: column;
	overflow: hidden;
}
.embed-modal__head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 12px;
	padding: 20px 20px 12px;
}
.embed-modal__title {
	margin: 0;
	font-size: 18px;
	font-weight: 600;
	letter-spacing: -0.3px;
}
.embed-modal__sub {
	margin: 4px 0 0;
	font-size: 13px;
	color: rgba(229, 229, 229, 0.55);
}
.embed-modal__close {
	background: transparent;
	border: 0;
	color: rgba(229, 229, 229, 0.6);
	font-size: 28px;
	line-height: 1;
	width: 32px;
	height: 32px;
	border-radius: 8px;
	cursor: pointer;
	transition: all 0.15s;
}
.embed-modal__close:hover {
	background: rgba(255, 255, 255, 0.08);
	color: #fff;
}
.embed-modal__tabs {
	display: flex;
	gap: 2px;
	padding: 0 20px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.06);
	overflow-x: auto;
	scrollbar-width: none;
}
.embed-modal__tabs::-webkit-scrollbar {
	display: none;
}
.embed-tab {
	background: transparent;
	border: 0;
	color: rgba(229, 229, 229, 0.55);
	font: inherit;
	font-size: 13px;
	font-weight: 500;
	padding: 10px 14px;
	cursor: pointer;
	border-bottom: 2px solid transparent;
	margin-bottom: -1px;
	white-space: nowrap;
	transition: all 0.15s;
}
.embed-tab:hover {
	color: #e5e5e5;
}
.embed-tab.is-active {
	color: #fff;
	border-bottom-color: #8b5cf6;
}
.embed-modal__body {
	padding: 20px;
	overflow-y: auto;
	flex: 1;
}
.embed-pane {
	display: none;
}
.embed-pane.is-active {
	display: block;
}
.embed-pane__hint {
	margin: 0 0 10px;
	font-size: 13px;
	color: rgba(229, 229, 229, 0.6);
	line-height: 1.5;
}
.embed-snippet {
	display: block;
	width: 100%;
	background: #05070a;
	color: #d4d4d4;
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: 10px;
	padding: 12px 14px;
	font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
	font-size: 12px;
	line-height: 1.55;
	resize: vertical;
	box-sizing: border-box;
	outline: none;
}
.embed-snippet:focus {
	border-color: rgba(139, 92, 246, 0.5);
	box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}
.embed-snippet--input {
	resize: none;
}
.embed-copy-btn {
	margin-top: 10px;
	background: linear-gradient(135deg, #8b5cf6, #6d28d9);
	color: #fff;
	border: 0;
	border-radius: 8px;
	padding: 8px 16px;
	font: inherit;
	font-size: 13px;
	font-weight: 500;
	cursor: pointer;
	transition:
		transform 0.1s,
		box-shadow 0.15s;
}
.embed-copy-btn:hover {
	box-shadow: 0 4px 14px rgba(139, 92, 246, 0.4);
}
.embed-copy-btn:active {
	transform: translateY(1px);
}
.embed-modal__foot {
	padding: 12px 20px;
	border-top: 1px solid rgba(255, 255, 255, 0.06);
	display: flex;
	gap: 16px;
	justify-content: flex-end;
	flex-wrap: wrap;
}
.embed-foot-link {
	font-size: 12px;
	color: rgba(229, 229, 229, 0.55);
	text-decoration: none;
}
.embed-foot-link:hover {
	color: #8b5cf6;
}
.explore-card-link--ghost {
	background: transparent;
	border: 1px solid rgba(255, 255, 255, 0.12);
	color: rgba(229, 229, 229, 0.75);
	cursor: pointer;
	font: inherit;
	font-size: 12px;
	padding: 4px 10px;
	border-radius: 6px;
}
.explore-card-link--ghost:hover {
	border-color: rgba(139, 92, 246, 0.5);
	color: #fff;
}
@media (max-width: 560px) {
	.embed-modal__panel {
		max-height: calc(100vh - 16px);
	}
	.embed-modal__head,
	.embed-modal__body,
	.embed-modal__foot {
		padding-left: 14px;
		padding-right: 14px;
	}
	.embed-modal__tabs {
		padding-left: 14px;
		padding-right: 14px;
	}
}
