/* ============================================================
	HERO TECH — PICKER STYLES
	Merged shared/base styles + picker styles.
	Standalone stylesheet for the Picker component.
	============================================================ */

/* ============================================================
		HERO TECH — MULTI-PAGE SHARED STYLES
		Shared reset, shell, Three.js/WebGPU mount and global preloader.
		Each HTML page owns its own content/controller.
		============================================================ */

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; min-width: 320px; margin: 0; }
body { overflow: hidden; background: #000; }
button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

.app-shell { position: fixed; inset: 0; z-index: 10; overflow: hidden; pointer-events: none; }
.app-screen { position: absolute; inset: 0; width: 100%; height: 100%; overflow: hidden; }
.app-screen--auth, .app-screen--picker { pointer-events: auto; }
.app-screen--chat { pointer-events: none; }

#webgpu-root {
	position: fixed;
	inset: 0;
	z-index: 0;
	overflow: hidden;
	background: #000;
	opacity: 1;
	pointer-events: auto;
	transition: opacity 180ms ease;
}
body[data-screen="chat"] #webgpu-root { opacity: 1; pointer-events: auto; }
#webgpu-root > canvas { display: block; width: 100% !important; height: 100% !important; }

/* ---------------- GLOBAL PRELOADER ---------------- */
.app-preloader {
	position: fixed;
	inset: 0;
	z-index: 1000;
	display: grid;
	place-items: center;
	background: rgba(0,0,0,.88);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
	opacity: 0;
	pointer-events: none;
	transition: opacity 180ms ease;
}
.app-preloader.is-visible { opacity: 1; pointer-events: auto; }
.app-preloader__inner { display: grid; justify-items: center; gap: 17px; min-width: 240px; color: #f7deb0; font-family: Inter,ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; }
.app-preloader__mark { position: relative; width: 68px; height: 68px; }
.app-preloader__mark span { position: absolute; inset: 0; border: 1px solid transparent; border-top-color: #ffd279; border-radius: 50%; animation: heroTechSpin 1.15s linear infinite; filter: drop-shadow(0 0 7px rgba(255,183,55,.28)); }
.app-preloader__mark span:nth-child(2) { inset: 8px; border-top-color: #bd7422; animation-duration: .88s; animation-direction: reverse; }
.app-preloader__mark span:nth-child(3) { inset: 17px; border-top-color: rgba(255,233,190,.84); animation-duration: .72s; }
.app-preloader__mark i { position: absolute; left: 50%; top: 50%; width: 8px; height: 8px; translate: -50% -50%; rotate: 45deg; background: #efb54a; box-shadow: 0 0 14px rgba(255,185,54,.54); }
.app-preloader__label { font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: rgba(255,235,198,.78); }
.app-preloader__track { width: 220px; height: 2px; overflow: hidden; border-radius: 999px; background: rgba(255,255,255,.09); }
.app-preloader__track i { display: block; width: 0%; height: 100%; border-radius: inherit; background: linear-gradient(90deg,#a8661b,#ffd77b); box-shadow: 0 0 9px rgba(255,191,65,.32); transition: width 180ms ease; }
@keyframes heroTechSpin { to { transform: rotate(360deg); } }

/* Identical structural header/footer hooks on all three HTML pages.
		They remain non-visual so the approved screen designs do not change. */
.site-header,.site-footer{position:fixed;left:0;right:0;height:0;overflow:hidden;pointer-events:none;z-index:20}
.site-header{top:0}
.site-footer{bottom:0}

/* ============================================================
	PICKER
	============================================================ */

/* ---------------- PICKER SCREEN VARIABLES ---------------- */
#screen-picker {

	--gold-1:#fff5ca;
	--gold-2:#ffd66c;
	--gold-3:#ff9d1f;
	--gold-4:#a95108;
	--panel-source-w:961px;
	--panel-source-h:993px;
	--panel-ui-scale:.72;

	font-family: Georgia,"Times New Roman","Noto Serif",serif;
	color: #fff;
	background: #0b0806;
}

/* ---------------- AVATAR PICKER (design preserved) ---------------- */

.viewport{
	position:relative;
	width:100vw;
	height:100vh;
	overflow:hidden;
	background:#0b0806;
	isolation:isolate;
}
.viewport::before{
	content:"";
	position:absolute;
	inset:-26px;
	background:#0b0806 url("../img/picker/background.webp") center center/cover no-repeat;
	filter:blur(16px) brightness(.82) saturate(.92);
	transform:scale(1.035);
	transform-origin:center;
	z-index:0;
	pointer-events:none;
}
.world{
	--world-scale:1;
	position:absolute;
	left:50%;
	top:50%;
	width:1672px;
	height:941px;
	transform:translate(-50%,-50%) scale(var(--world-scale));
	transform-origin:center center;
	overflow:hidden;
	isolation:isolate;
	background:#1c140e;
	z-index:1;
}
.scene-bg{
	position:absolute;
	inset:0;
	width:100%;
	height:100%;
	object-fit:fill;
	user-select:none;
	pointer-events:none;
	z-index:0;
}
.scene-shade{
	position:absolute;
	inset:0;
	pointer-events:none;
	z-index:1;
	background:
		linear-gradient(90deg,rgba(14,8,4,.19) 0%,rgba(14,8,4,.07) 43%,transparent 64%),
		radial-gradient(ellipse at 68% 62%,transparent 0 30%,rgba(36,19,6,.04) 62%,rgba(16,8,3,.11) 100%);
}

/* Panel(1).psd is 961×993. It is rendered smaller as one fixed design object. */
.selector{
	position:absolute;
	left:68px;
	top:92px;
	width:692px;
	height:715px;
	z-index:10;
	perspective:1800px;
}
.panel-scale{
	position:absolute;
	left:0;
	top:0;
	width:var(--panel-source-w);
	height:var(--panel-source-h);
	transform:scale(var(--panel-ui-scale));
	transform-origin:0 0;
}
.panel-motion{
	--tilt-x:0deg;
	--tilt-y:0deg;
	--shift-x:0px;
	--shift-y:0px;
	position:absolute;
	inset:0;
	width:961px;
	height:993px;
	transform:none;
	transform-style:flat;
	transition:none;
}
.panel-frame,.panel-core{position:absolute;inset:0;pointer-events:none}
.panel-piece{position:absolute;display:block;pointer-events:none;user-select:none}

/* Top + Bottom start compressed around the middle flash and snap to their PSD positions. */
.panel-top{
	left:30px;top:0;width:902px;height:210px;
	opacity:0;
	transform:translateY(392px);
	animation:topDeploy .64s cubic-bezier(.12,.88,.18,1) 1.58s forwards;
	z-index:22;
}
.panel-bottom{
	left:25px;top:846px;width:907px;height:147px;
	opacity:0;
	transform:translateY(-423px);
	animation:bottomDeploy .64s cubic-bezier(.12,.88,.18,1) 1.58s forwards;
	z-index:22;
}

/* RC / LC Side Colom: compressed at the centre, then stretched with Top/Bottom. */
.side-column{
	top:91px;width:31px;height:836px;
	opacity:0;
	transform:scaleY(.012);
	transform-origin:50% 50%;
	animation:columnDeploy .64s cubic-bezier(.12,.88,.18,1) 1.58s forwards;
	z-index:21;
}
.side-column--left{left:25px}
.side-column--right{left:905px}

/* Inner panel box: Layer 6 + Place A + Place B and their inner ornaments.
		It grows vertically while fading in near the end of the frame opening. */
.panel-core{
	opacity:1;
	transform:none;
	transform-origin:50% 50%;
	animation:none;
	z-index:12;
}
.core-layer--6{left:55px;top:90px;width:851px;height:829px;z-index:1}
.core-place-a{left:46px;top:211px;width:861px;height:634px;z-index:2}
.core-place-b{left:316px;top:845px;width:310px;height:39px;z-index:8}
.core-layer--1{left:23px;top:133px;width:896px;height:147px;z-index:9}
.core-layer--2l{left:54px;top:820px;width:279px;height:67px;z-index:9}
.core-layer--2r{left:609px;top:820px;width:296px;height:67px;z-index:9}
.core-layer--3{left:538px;top:134px;width:394px;height:847px;z-index:10}
.core-layer--4{left:30px;top:134px;width:394px;height:847px;z-index:10}

/* LC / RC sidebar groups appear only after the vertical frame is almost open. */
.side-control{
	position:absolute;
	top:394px;
	width:83px;
	height:268px;
	padding:0;
	border:0;
	background:transparent;
	cursor:pointer;
	z-index:34;
	opacity:0;
	transform:scale(.96);
	animation:sideControlIn .22s ease-out 2.08s forwards;
}
.side-control--left{left:0}
.side-control--right{left:878px}
.side-control__bar{position:absolute;inset:0;width:83px;height:268px;pointer-events:none;user-select:none}
.side-control__arrow{
	position:absolute;
	top:103px;
	width:34px;
	height:62px;
	pointer-events:none;
	user-select:none;
	opacity:.96;
	transition:filter .16s ease,transform .16s ease,opacity .16s ease;
}
.side-control__arrow--left{left:20px}
.side-control__arrow--right{left:29px}
.side-control:hover .side-control__arrow,
.side-control:focus-visible .side-control__arrow{
	opacity:1;
	transform:scale(1.08);
	filter:brightness(1.62)
		drop-shadow(0 0 4px rgba(255,249,218,1))
		drop-shadow(0 0 11px rgba(255,171,42,.95))
		drop-shadow(0 0 20px rgba(255,102,0,.72));
}
.side-control.is-pulsing .side-control__arrow{animation:arrowPulse .50s ease-out}
.side-control:focus-visible{outline:none}

.panel-title{
	position:absolute;
	left:217px;
	top:136px;
	width:527px;
	margin:0;
	text-align:center;
	font-size:31px;
	line-height:1;
	font-weight:600;
	letter-spacing:.08em;
	text-transform:uppercase;
	color:#ffe4a1;
	text-shadow:0 0 5px #fff0bd,0 0 12px #ff9d1f,0 2px 3px #2a1000;
	opacity:0;
	animation:contentIn .30s ease-out 2.18s forwards;
	pointer-events:none;
	z-index:38;
}

/* Exact Place A from Panel(1).psd: x46 y211 w861 h634.
		Cards reduced for better balance.
		Width: 3×210 + 2×40 = 710, centered inside Place A.
		Height: 2×292 + 30 = 614, vertically centered inside Place A. */
.card-zone{
	position:absolute;
	left:46px;
	top:211px;
	width:861px;
	height:634px;
	overflow:hidden;
	opacity:0;
	animation:contentIn .30s ease-out 2.18s forwards;
	z-index:36;
}
.hero-grid{
	position:absolute;
	inset:0;
	display:grid;
	grid-template-columns:repeat(3,210px);
	grid-template-rows:repeat(2,292px);
	column-gap:40px;
	row-gap:30px;
	align-content:center;
	justify-content:center;
}
.hero-grid.slide-from-right{animation:pageFromRight .32s cubic-bezier(.2,.75,.24,1)}
.hero-grid.slide-from-left{animation:pageFromLeft .32s cubic-bezier(.2,.75,.24,1)}

.hero-card{
	position:relative;
	width:210px;
	height:292px;
	padding:0;
	border:0;
	background:transparent;
	cursor:pointer;
	isolation:isolate;
	opacity:0;
	transform:scale(.985);
	animation:cardAppear .28s cubic-bezier(.18,.8,.22,1) forwards;
}
.hero-card:nth-child(1){animation-delay:2.18s}
.hero-card:nth-child(2){animation-delay:2.22s}
.hero-card:nth-child(3){animation-delay:2.26s}
.hero-card:nth-child(4){animation-delay:2.30s}
.hero-card:nth-child(5){animation-delay:2.34s}
.hero-card:nth-child(6){animation-delay:2.38s}
.hero-grid.slide-from-right .hero-card,
.hero-grid.slide-from-left .hero-card{animation-delay:0s;opacity:1;transform:none}
.hero-card__visual{
	position:absolute;
	inset:0;
	display:block;
	transform-origin:50% 50%;
	pointer-events:none;
}
.hero-card__art{
	position:absolute;
	inset:0;
	width:100%;
	height:100%;
	object-fit:contain;
	z-index:2;
	pointer-events:none;
	user-select:none;
	/* Alpha-shaped glow only. No rectangular/card-container glow. */
	transition:filter .18s ease;
}
.hero-card:hover .hero-card__art,
.hero-card:focus-visible .hero-card__art{
	filter:brightness(1.11) saturate(1.08)
		drop-shadow(0 0 3px rgba(255,249,220,1))
		drop-shadow(0 0 9px rgba(255,194,67,.94))
		drop-shadow(0 0 18px rgba(255,119,8,.72));
}
.hero-card.is-selected .hero-card__art{
	filter:brightness(1.14) saturate(1.09)
		drop-shadow(0 0 4px rgba(255,249,220,1))
		drop-shadow(0 0 11px rgba(255,188,51,.98))
		drop-shadow(0 0 22px rgba(255,103,5,.78));
}
.hero-card:focus-visible{outline:none}

/* Etalon A/B remain inside the same 227×315 visual object, so they can never detach. */
.hero-card__symbol-slot{
	position:absolute;
	left:40.5941%;
	top:70.2381%;
	width:18.6469%;
	height:13.0357%;
	z-index:4;
	display:grid;
	place-items:center;
	border-radius:50%;
	overflow:hidden;
	pointer-events:none;
}
.hero-card__symbol{
	width:91%;
	height:91%;
	object-fit:contain;
	border-radius:50%;
	filter:brightness(1.08) drop-shadow(0 0 5px rgba(255,170,32,.62));
}
.hero-card__name{
	position:absolute;
	left:28.1353%;
	top:85.5952%;
	width:44.3069%;
	height:5.4167%;
	z-index:5;
	display:flex;
	align-items:center;
	justify-content:center;
	overflow:hidden;
	white-space:nowrap;
	text-align:center;
	font-family:Georgia,"Times New Roman",serif;
	font-size:16px;
	line-height:1;
	font-weight:700;
	letter-spacing:.025em;
	color:#fff0bd;
	text-shadow:0 0 4px #ffbd55,0 1px 2px #381a04;
	pointer-events:none;
}

/* Exact Place B from Panel(1).psd: x316 y845 w310 h39. */
.pager{
	position:absolute;
	left:316px;
	top:845px;
	width:310px;
	height:39px;
	display:flex;
	align-items:center;
	justify-content:center;
	gap:23px;
	opacity:0;
	animation:contentIn .30s ease-out 2.18s forwards;
	z-index:44;
}
.pager-dot{
	width:14px;
	height:14px;
	padding:0;
	border:1.6px solid rgba(255,214,112,.96);
	border-radius:0;
	background:rgba(30,15,5,.28);
	cursor:pointer;
	transform:rotate(45deg);
	box-shadow:0 0 4px rgba(255,147,17,.20),inset 0 0 3px rgba(255,213,112,.17);
	transition:transform .16s ease,background .16s ease,box-shadow .16s ease,filter .16s ease;
}
.pager-dot:hover,.pager-dot:focus-visible{
	outline:none;
	filter:brightness(1.25);
	box-shadow:0 0 5px rgba(255,225,151,.88),0 0 11px rgba(255,142,15,.50);
}
.pager-dot.is-active{
	background:linear-gradient(135deg,#fff3bd 0%,#ffc655 45%,#a64d06 100%);
	transform:rotate(45deg) scale(1.13);
	box-shadow:0 0 4px #fff3c7,0 0 10px #ffb43c,0 0 18px rgba(255,111,0,.84);
}

/* Short line flash that starts the whole sequence. */
.opening-beam{
	position:absolute;
	left:58px;
	top:492px;
	width:845px;
	height:10px;
	pointer-events:none;
	z-index:80;
}
.beam{
	position:absolute;
	top:50%;
	width:0;
	height:2px;
	opacity:0;
	background:linear-gradient(90deg,transparent,#ffc85b 24%,#fff6d7 67%,#fff 100%);
	box-shadow:0 0 6px #fff6d5,0 0 16px #ffba3b,0 0 38px rgba(255,124,0,.85);
}
.beam--left{
	right:50%;
	transform:translateY(-50%) scaleX(-1);
	transform-origin:right center;
	animation:beamLeft .48s cubic-bezier(.1,.74,.24,1) .04s forwards;
}
.beam--right{
	left:50%;
	transform:translateY(-50%);
	transform-origin:left center;
	animation:beamRight .48s cubic-bezier(.1,.74,.24,1) .04s forwards;
}
.beam-core{
	position:absolute;
	left:50%;top:50%;
	width:8px;height:8px;
	border-radius:50%;
	transform:translate(-50%,-50%) scale(0);
	background:#fff;
	box-shadow:0 0 8px 4px #fff6d2,0 0 24px 12px rgba(255,173,42,.9),0 0 48px 18px rgba(255,105,0,.55);
	opacity:0;
	animation:beamCore 1.04s cubic-bezier(.12,.72,.18,1) .44s forwards;
}

.opening-beam::after{
	content:"";
	position:absolute;
	left:50%;
	top:50%;
	width:980px;
	height:300px;
	transform:translate(-50%,-50%) scale(.18);
	border-radius:50%;
	opacity:0;
	background:radial-gradient(ellipse at center,
		rgba(255,255,244,.98) 0%,
		rgba(255,245,196,.92) 8%,
		rgba(255,190,72,.66) 23%,
		rgba(255,115,8,.25) 47%,
		transparent 72%);
	filter:blur(2px);
	mix-blend-mode:screen;
	box-shadow:0 0 44px 12px rgba(255,240,186,.72),0 0 120px 34px rgba(255,129,10,.38);
	animation:openingFlash 1.02s cubic-bezier(.16,.72,.18,1) .43s forwards;
	pointer-events:none;
}

/* The structural background expands with the frame, so it never lags behind it. */
.core-layer--6,.core-place-a,.core-place-b{
	opacity:0;
	transform:scaleY(.025);
	transform-origin:50% 50%;
	animation:coreBaseDeploy .64s cubic-bezier(.12,.88,.18,1) 1.58s forwards;
}

/* Decorative ornaments do not stretch: they simply fade in with the cards. */
.core-layer--1,.core-layer--2l,.core-layer--2r,.core-layer--3,.core-layer--4{
	opacity:0;
	transform:none;
	animation:ornamentFade .30s ease-out 2.18s forwards;
}

.spark-layer{position:absolute;inset:0;pointer-events:none;z-index:60;overflow:visible}
.spark{
	position:absolute;
	width:3px;height:3px;
	border-radius:50%;
	opacity:0;
	background:#fff5c4;
	box-shadow:0 0 5px 2px #ffd05c,0 0 11px #ff8f12;
	animation:sparkleFloat var(--duration,1.9s) ease-out var(--delay,1.0s) both;
}
.spark--cross::before,.spark--cross::after{
	content:"";
	position:absolute;
	left:50%;top:50%;
	transform:translate(-50%,-50%);
	background:#fff7d2;
	box-shadow:0 0 6px #ffc24c;
}
.spark--cross::before{width:1px;height:9px}
.spark--cross::after{width:9px;height:1px}
/* Stage is aligned to the background's podium in the fixed 1672×941 design. */
.stage{
	position:absolute;
	left:948px;
	top:112px;
	width:432px;
	height:603px;
	z-index:6;
	display:flex;
	align-items:flex-end;
	justify-content:center;
	pointer-events:none;
}
.stage-character{
	--hero-scale:1;
	--hero-x:0px;
	--hero-y:0px;
	position:absolute;
	left:50%;
	bottom:1px;
	width:420px;
	height:582px;
	object-fit:contain;
	object-position:center bottom;
	opacity:0;
	transform:translate(calc(-50% + var(--hero-x)),calc(18px + var(--hero-y))) scale(calc(var(--hero-scale) * .965));
	transform-origin:50% 100%;
	filter:drop-shadow(0 18px 12px rgba(47,24,5,.22));
	transition:opacity .16s ease;
}
.stage-character.is-visible{opacity:1}
.stage-character.swap-in{animation:heroRise .52s cubic-bezier(.16,.8,.22,1) both}
.stage-glow{
	position:absolute;
	left:50%;
	bottom:8px;
	width:250px;
	height:58px;
	transform:translateX(-50%);
	border-radius:50%;
	opacity:0;
	background:radial-gradient(ellipse at center,rgba(255,231,166,.45),rgba(255,169,48,.18) 38%,transparent 72%);
	filter:blur(3px);
	transition:opacity .35s ease;
}
.stage-glow.is-visible{opacity:.86}

/* Compact version of the supplied Enter to Chat CSS design. */
.qimen-chat-btn{
	--h:62px;
	--side:48px;
	position:absolute;
	left:1164px;
	top:822px;
	width:360px;
	min-height:var(--h);
	transform:translate(-50%,12px) scale(.96);
	transform-origin:center;
	opacity:0;
	visibility:hidden;
	border:0;
	padding:0 calc(var(--side) + 17px);
	border-radius:15px;
	color:var(--gold-1);
	cursor:pointer;
	z-index:18;
	isolation:isolate;
	background:
		linear-gradient(180deg,rgba(255,186,64,.05),transparent 24%,rgba(0,0,0,.2)),
		radial-gradient(circle at 50% 0%,rgba(255,177,54,.12),transparent 42%),
		linear-gradient(180deg,#21150b 0%,#130d08 52%,#090706 100%);
	box-shadow:0 0 0 1px rgba(255,218,124,.22) inset,0 0 0 2px rgba(154,79,6,.72) inset,0 12px 27px rgba(0,0,0,.40),0 0 20px rgba(255,142,18,.18);
	transition:opacity .25s ease,transform .25s ease,filter .2s ease,box-shadow .2s ease,visibility .25s;
}
.qimen-chat-btn[hidden]{display:none}
.qimen-chat-btn.is-visible{opacity:1;visibility:visible;transform:translate(-50%,0) scale(1)}
.qimen-chat-btn::before,.qimen-chat-btn::after{content:"";position:absolute;pointer-events:none;inset:0;border-radius:inherit}
.qimen-chat-btn::before{
	inset:5px;
	border:1px solid transparent;
	background:linear-gradient(#15100b,#15100b) padding-box,linear-gradient(90deg,var(--gold-4),var(--gold-2) 12%,var(--gold-1) 20%,var(--gold-3) 50%,var(--gold-1) 80%,var(--gold-2) 88%,var(--gold-4)) border-box;
	box-shadow:0 0 11px rgba(255,154,24,.34),0 0 7px rgba(255,213,105,.22) inset;
	z-index:-1;
}
.qimen-chat-btn::after{inset:10px;border-top:1px solid rgba(255,213,105,.45);border-bottom:1px solid rgba(255,157,31,.28);opacity:.9}
.qimen-chat-btn__content{position:relative;min-height:var(--h);display:flex;align-items:center;justify-content:center;gap:12px}
.qimen-chat-btn__label{
	position:relative;
	z-index:2;
	font-size:22px;
	line-height:1;
	letter-spacing:.02em;
	white-space:nowrap;
	color:#fff2c7;
	text-shadow:0 0 4px #fff5cf,0 0 9px #ffc35b,0 0 18px #ff8a0b,0 0 26px rgba(255,113,0,.62);
}
.qimen-chat-btn__spark{width:27px;height:1px;position:relative;flex:0 0 auto;background:linear-gradient(90deg,transparent,rgba(255,211,105,.72),transparent)}
.qimen-chat-btn__spark::before,.qimen-chat-btn__spark::after{content:"";position:absolute;top:50%;width:4px;height:4px;background:var(--gold-2);transform:translateY(-50%) rotate(45deg);box-shadow:0 0 6px rgba(255,157,31,.82)}
.qimen-chat-btn__spark::before{left:5px}.qimen-chat-btn__spark::after{right:5px}
.qimen-chat-btn__side{position:absolute;top:50%;width:var(--side);height:38px;transform:translateY(-50%);z-index:3;filter:drop-shadow(0 0 8px rgba(255,147,18,.5))}
.qimen-chat-btn__side--left{left:8px}.qimen-chat-btn__side--right{right:8px}
.qimen-chat-btn__side::before{content:"";position:absolute;inset:3px;border:1px solid var(--gold-2);background:linear-gradient(180deg,rgba(255,206,93,.15),transparent 38%),#1b1008;clip-path:polygon(0 50%,24% 7%,76% 7%,100% 50%,76% 93%,24% 93%);box-shadow:0 0 0 1px #7d3d05 inset,0 0 9px rgba(255,144,17,.30) inset}
.qimen-chat-btn__side::after{content:"";position:absolute;top:50%;width:8px;height:8px;border:1px solid var(--gold-2);transform:translateY(-50%) rotate(45deg);background:#261508;box-shadow:0 0 6px rgba(255,164,28,.7)}
.qimen-chat-btn__side--left::after{left:-1px}.qimen-chat-btn__side--right::after{right:-1px}
.qimen-chat-btn__chevron{position:absolute;left:50%;top:50%;width:12px;height:12px;border-top:3px solid #ffe397;border-right:3px solid #ffe397;filter:drop-shadow(0 0 5px rgba(255,152,22,.85))}
.qimen-chat-btn__side--left .qimen-chat-btn__chevron{transform:translate(-38%,-50%) rotate(225deg)}
.qimen-chat-btn__side--right .qimen-chat-btn__chevron{transform:translate(-62%,-50%) rotate(45deg)}
.qimen-chat-btn__ornament{position:absolute;left:50%;width:20px;height:20px;transform:translateX(-50%) rotate(45deg);border:2px solid var(--gold-2);background:linear-gradient(135deg,#2b180b 0 46%,#4a2508 47% 53%,#130b06 54% 100%);box-shadow:0 0 0 2px rgba(109,48,3,.9) inset,0 0 8px rgba(255,157,31,.82);z-index:4}
.qimen-chat-btn__ornament::after{content:"";position:absolute;inset:5px;border:1px solid #ffe8a3;box-shadow:0 0 5px rgba(255,190,58,.75)}
.qimen-chat-btn__ornament--top{top:-9px}.qimen-chat-btn__ornament--bottom{bottom:-9px}
.qimen-chat-btn:hover{filter:brightness(1.14) saturate(1.08);box-shadow:0 0 0 1px rgba(255,240,185,.34) inset,0 0 0 2px rgba(180,92,9,.80) inset,0 13px 29px rgba(0,0,0,.46),0 0 31px rgba(255,142,18,.34)}
.qimen-chat-btn:active{transform:translate(-50%,1px) scale(.994)}
.qimen-chat-btn:focus-visible{outline:2px solid #ffe39a;outline-offset:5px}
.qimen-chat-btn.clicked{animation:buttonClick .48s ease-out}


/* Bottom-left navigation back to the main page. */
.picker-back-main{
	position:absolute;
	left:34px;
	bottom:28px;
	min-width:170px;
	height:48px;
	padding:0 20px 0 16px;
	display:flex;
	align-items:center;
	justify-content:center;
	gap:10px;
	border:1px solid rgba(255,214,112,.58);
	border-radius:9px;
	background:linear-gradient(180deg,rgba(42,25,11,.82),rgba(19,10,4,.88));
	box-shadow:
		inset 0 0 0 1px rgba(255,238,184,.08),
		0 8px 22px rgba(0,0,0,.28),
		0 0 16px rgba(255,145,22,.10);
	color:#ffe4a1;
	font-family:Georgia,"Times New Roman","Noto Serif",serif;
	font-size:16px;
	font-weight:600;
	letter-spacing:.035em;
	text-decoration:none;
	text-shadow:0 0 7px rgba(255,166,39,.42);
	cursor:pointer;
	z-index:70;
	transition:
		border-color .18s ease,
		color .18s ease,
		filter .18s ease,
		box-shadow .18s ease,
		transform .18s ease;
}
.picker-back-main svg{
	width:21px;
	height:21px;
	fill:none;
	stroke:currentColor;
	stroke-width:1.8;
	stroke-linecap:round;
	stroke-linejoin:round;
	flex:0 0 auto;
}
.picker-back-main:hover{
	color:#fff2c2;
	border-color:rgba(255,226,146,.92);
	filter:brightness(1.12);
	box-shadow:
		inset 0 0 0 1px rgba(255,242,198,.14),
		0 9px 24px rgba(0,0,0,.34),
		0 0 22px rgba(255,151,24,.24);
}
.picker-back-main:active{transform:translateY(1px)}
.picker-back-main:focus-visible{outline:2px solid #ffe39a;outline-offset:4px}

@keyframes beamLeft{
	0%{width:0;opacity:0}
	12%{opacity:1}
	70%{width:50%;opacity:1;height:3px}
	100%{width:50%;opacity:0;height:1px}
}
@keyframes beamRight{
	0%{width:0;opacity:0}
	12%{opacity:1}
	70%{width:50%;opacity:1;height:3px}
	100%{width:50%;opacity:0;height:1px}
}
@keyframes beamCore{
	0%{opacity:0;transform:translate(-50%,-50%) scale(.15)}
	13%{opacity:1;transform:translate(-50%,-50%) scale(1.55)}
	42%{opacity:1;transform:translate(-50%,-50%) scale(2.35)}
	72%{opacity:.68;transform:translate(-50%,-50%) scale(2.85)}
	100%{opacity:0;transform:translate(-50%,-50%) scale(3.35)}
}
@keyframes openingFlash{
	0%{opacity:0;transform:translate(-50%,-50%) scale(.18)}
	10%{opacity:.92;transform:translate(-50%,-50%) scale(.64)}
	25%{opacity:1;transform:translate(-50%,-50%) scale(1)}
	54%{opacity:.88;transform:translate(-50%,-50%) scale(1.08)}
	78%{opacity:.36;transform:translate(-50%,-50%) scale(1.03)}
	100%{opacity:0;transform:translate(-50%,-50%) scale(.96)}
}
@keyframes coreBaseDeploy{
	0%{opacity:0;transform:scaleY(.025);filter:brightness(1.55)}
	14%{opacity:.40}
	68%{opacity:.96;filter:brightness(1.08)}
	100%{opacity:1;transform:scaleY(1);filter:brightness(1)}
}
@keyframes ornamentFade{
	from{opacity:0}
	to{opacity:1}
}
@keyframes topDeploy{
	0%{opacity:0;transform:translateY(392px) scaleX(.90);filter:brightness(1.8)}
	12%{opacity:1}
	72%{filter:brightness(1.12)}
	100%{opacity:1;transform:translateY(0) scaleX(1);filter:brightness(1)}
}
@keyframes bottomDeploy{
	0%{opacity:0;transform:translateY(-423px) scaleX(.90);filter:brightness(1.8)}
	12%{opacity:1}
	72%{filter:brightness(1.12)}
	100%{opacity:1;transform:translateY(0) scaleX(1);filter:brightness(1)}
}
@keyframes columnDeploy{
	0%{opacity:0;transform:scaleY(.012);filter:brightness(2)}
	10%{opacity:.85}
	70%{filter:brightness(1.16)}
	100%{opacity:1;transform:scaleY(1);filter:brightness(1)}
}
@keyframes coreDeploy{
	0%{opacity:0;transform:scaleY(.025);filter:brightness(1.6)}
	22%{opacity:.46}
	68%{opacity:.94;filter:brightness(1.10)}
	100%{opacity:1;transform:scaleY(1);filter:brightness(1)}
}
@keyframes sideControlIn{
	from{opacity:0;transform:scale(.96)}
	to{opacity:1;transform:scale(1)}
}
@keyframes contentIn{from{opacity:0}to{opacity:1}}
@keyframes cardAppear{to{opacity:1;transform:scale(1)}}
@keyframes sparkleFloat{
	0%{opacity:0;transform:translate(0,0) scale(.3)}
	22%{opacity:.9}
	68%{opacity:.58}
	100%{opacity:0;transform:translate(var(--sx),var(--sy)) scale(.15)}
}
@keyframes arrowPulse{
	0%{transform:scale(1);filter:brightness(1)}
	34%{transform:scale(1.20);filter:brightness(2) drop-shadow(0 0 5px #fff7d5) drop-shadow(0 0 13px #ff9f1e) drop-shadow(0 0 23px #ff6a00)}
	100%{transform:scale(1);filter:brightness(1)}
}
@keyframes pageFromRight{from{opacity:.15;transform:translateX(26px)}to{opacity:1;transform:none}}
@keyframes pageFromLeft{from{opacity:.15;transform:translateX(-26px)}to{opacity:1;transform:none}}
@keyframes heroRise{
	0%{opacity:0;transform:translate(calc(-50% + var(--hero-x)),calc(20px + var(--hero-y))) scale(calc(var(--hero-scale) * .955));filter:blur(2px) drop-shadow(0 18px 12px rgba(47,24,5,.22))}
	55%{opacity:1}
	100%{opacity:1;transform:translate(calc(-50% + var(--hero-x)),var(--hero-y)) scale(var(--hero-scale));filter:blur(0) drop-shadow(0 18px 12px rgba(47,24,5,.22))}
}
@keyframes buttonClick{50%{filter:brightness(1.55);box-shadow:0 0 28px rgba(255,149,22,.62)}}

.spark--weld{
	width:2px;
	height:2px;
	background:#fff8d8;
	box-shadow:0 0 6px 2px #ffd36a,0 0 16px 4px rgba(255,138,12,.92);
	animation:weldBurst var(--duration,.72s) cubic-bezier(.12,.8,.24,1) var(--delay,0s) both;
}
.spark--weld::after{
	content:"";
	position:absolute;
	left:50%;
	top:50%;
	width:1px;
	height:13px;
	background:linear-gradient(180deg,rgba(255,246,214,.9),rgba(255,182,55,.45),transparent 100%);
	transform:translate(-50%,-85%) rotate(var(--rot,0deg));
	transform-origin:50% 100%;
	box-shadow:0 0 5px rgba(255,178,52,.45);
}

@keyframes weldBurst{
	0%{opacity:0;transform:translate(0,0) scale(.15)}
	12%{opacity:1;transform:translate(calc(var(--tx) * .12),calc(var(--ty) * .12)) scale(1)}
	42%{opacity:1}
	100%{opacity:0;transform:translate(var(--tx),var(--ty)) scale(.1)}
}

/* ============================================================
	CHAT
	============================================================ */

/* ---------------- CHAT SCREEN VARIABLES ---------------- */
#screen-chat {

	--gold: #e3a83d;
	--gold-strong: #ffc45d;
	--gold-soft: rgba(227, 168, 61, 0.38);
	--line: rgba(227, 168, 61, 0.72);
	--text: #f3f0ea;
	--muted: rgba(243, 240, 234, 0.55);
	--glass: rgba(12, 12, 13, 0.72);
	--glass-strong: rgba(11, 11, 12, 0.86);
	--soft-border: rgba(255, 255, 255, 0.12);
	--sidebar-w: 292px;
	--chat-w: min(390px, calc(100vw - 40px));
	--dock-h: 64px;

	color: var(--text);
	font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	background: transparent;
}
#screen-chat button { color: inherit; }

/* ---------------- AVATAR CHAT / EDITOR (design preserved) ---------------- */

/* Three.js/WebGPU owns the scene completely. */

.ui-shell {
	position: fixed;
	inset: 0;
	z-index: 10;
	pointer-events: none;
}
.ui-shell button,
.ui-shell input,
.ui-shell aside,
.ui-shell form { pointer-events: auto; }

/* ---------------- LEFT SIDEBAR ---------------- */
.sidebar {
	position: absolute;
	inset: 0 auto 0 0;
	width: var(--sidebar-w);
	display: flex;
	flex-direction: column;
	background:
		linear-gradient(180deg, rgba(20, 18, 15, 0.83), rgba(8, 8, 9, 0.80)),
		rgba(8, 8, 9, 0.68);
	border-right: 1px solid var(--line);
	border-left: 0;
	border-radius: 0;
	box-shadow: 18px 0 44px rgba(0, 0, 0, 0.18);
	backdrop-filter: blur(18px) saturate(112%);
	-webkit-backdrop-filter: blur(18px) saturate(112%);
	transform: translateX(0);
	transition: transform 260ms cubic-bezier(.2,.75,.2,1), opacity 220ms ease;
}
.sidebar.is-closed {
	transform: translateX(calc(-1 * var(--sidebar-w)));
	opacity: 0.98;
}
.sidebar__header {
	height: 58px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 10px 14px 4px 14px;
}
.icon-button {
	width: 38px;
	height: 38px;
	display: grid;
	place-items: center;
	border: 1px solid var(--soft-border);
	border-radius: 10px;
	background: rgba(255,255,255,0.025);
	cursor: pointer;
	transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}
.icon-button--plain { border-color: transparent; background: #000; }
.icon-button:hover { border-color: var(--line); background: rgba(227,168,61,0.07); }
.icon-button:active { transform: scale(.97); }
.icon-button svg,
.sidebar-opener svg,
.sidebar-action svg,
.history-item svg,
.account svg,
.dock-button svg,
.composer__icon svg,
.avatar-editor svg {
	width: 20px;
	height: 20px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.7;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.sidebar__search {
	margin: 4px 14px 8px;
	height: 42px;
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 0 12px;
	border: 1px solid var(--soft-border);
	border-radius: 11px;
	background: rgba(255,255,255,0.035);
}
.sidebar__search[hidden] { display: none; }
.sidebar__search svg { width: 18px; height: 18px; fill: none; stroke: var(--muted); stroke-width: 1.8; }
.sidebar__search input {
	min-width: 0;
	flex: 1;
	border: 0;
	outline: 0;
	background: #000;
	color: var(--text);
}
.sidebar__search input::placeholder { color: var(--muted); }

.sidebar__primary {
	display: grid;
	gap: 7px;
	padding: 8px 14px 10px;
}
.sidebar-action {
	min-height: 48px;
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 0 14px;
	border: 1px solid var(--soft-border);
	border-radius: 11px;
	background: rgba(255,255,255,0.025);
	text-align: left;
	cursor: pointer;
	transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}
.sidebar-action:hover,
.sidebar-action.is-active {
	border-color: var(--line);
	background: rgba(227,168,61,0.085);
	box-shadow: inset 0 0 18px rgba(227,168,61,.035), 0 0 14px rgba(227,168,61,.045);
}
.sidebar-action.is-active { box-shadow: inset 0 0 18px rgba(227,168,61,0.035); }
.sidebar-action:disabled { opacity: .48; cursor: not-allowed; }
.sidebar-action__icon { width: 22px; display: grid; place-items: center; color: var(--gold-strong); }

.sidebar__scroll {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	padding: 0 14px 18px;
	scrollbar-width: thin;
	scrollbar-color: rgba(227,168,61,.35) transparent;
}
.chat-group + .chat-group { margin-top: 6px; border-top: 1px solid rgba(255,255,255,.08); padding-top: 6px; }
.chat-group__title {
	width: 100%;
	height: 42px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0 4px;
	border: 0;
	background: #000;
	cursor: pointer;
	color: rgba(255,255,255,.78);
	font-size: 14px;
	border-radius: 8px;
	transition: background 160ms ease, color 160ms ease;
}
.chat-group__title:hover {
	background: rgba(227,168,61,.055);
	color: #fff;
}
.chat-group__title svg { width: 16px; height: 16px; fill: none; stroke: var(--gold-strong); stroke-width: 1.8; transition: transform 160ms ease; }
.chat-group.is-collapsed .chat-group__title svg { transform: rotate(180deg); }
.chat-group.is-collapsed .chat-group__items { display: none; }
.chat-group__items { display: grid; gap: 3px; }
.history-item {
	width: 100%;
	min-height: 54px;
	display: grid;
	grid-template-columns: 26px 1fr;
	gap: 10px;
	align-items: center;
	padding: 8px 8px;
	border: 1px solid transparent;
	border-radius: 10px;
	background: #000;
	text-align: left;
	cursor: pointer;
	color: rgba(255,255,255,.82);
	transition: background 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}
.history-item:hover {
	background: rgba(227,168,61,.055);
	border-color: rgba(227,168,61,.28);
	box-shadow: inset 0 0 14px rgba(227,168,61,.025);
}
.history-item.is-selected {
	border-color: var(--line);
	background: rgba(227,168,61,.07);
}
.history-item__icon { color: var(--gold-strong); }
.history-item__icon svg { width: 19px; height: 19px; }
.history-item__copy { min-width: 0; display: grid; gap: 3px; }
.history-item__copy strong {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	font-size: 13px;
	font-weight: 550;
}
.history-item__copy small { color: var(--muted); font-size: 11px; }
.history-item.is-filtered-out { display: none; }

/* Chat history: separate open and ⋯ action controls per conversation. */
.history-entry { display:grid; grid-template-columns:minmax(0,1fr) 34px; gap:2px; align-items:center; min-width:0; }
.history-entry.is-filtered-out { display:none; }
.history-entry .history-item { min-width:0; }
.history-entry__toggle { width:34px; height:38px; padding:0; border:1px solid transparent; border-radius:9px; background:transparent; color:var(--gold-strong); cursor:pointer; font-size:23px; font-weight:700; line-height:1; }
.history-entry__toggle:hover, .history-entry__toggle[aria-expanded="true"] { background:rgba(227,168,61,.11); border-color:rgba(227,168,61,.28); }
.history-entry__menu { grid-column:1/-1; display:grid; grid-template-columns:1fr; gap:6px; padding:3px 3px 7px; }
.history-entry__menu[hidden] { display:none; }
.history-entry__action { min-height:35px; padding:5px 8px; border:1px solid rgba(227,168,61,.25); border-radius:8px; background:#16130f; color:#e8cc9b; cursor:pointer; text-align:center; font-size:12px; }
.history-entry__action:hover { background:rgba(227,168,61,.16); }
.history-entry__action--delete { color:#efb2ae; border-color:rgba(227,105,105,.2); }
.history-entry__action--delete:hover { background:rgba(227,105,105,.1); }


.account {
	position: relative;
	z-index: 5;
	border-top: 1px solid rgba(227,168,61,.32);
	background: rgba(0,0,0,.12);
	padding: 10px 14px 13px;
}
.account__button {
	width: 100%;
	min-height: 48px;
	display: grid;
	grid-template-columns: 38px 1fr;
	gap: 10px;
	align-items: center;
	padding: 0 8px;
	border: 1px solid transparent;
	border-radius: 10px;
	background: #000;
	cursor: pointer;
	text-align: left;
	transition: background 160ms ease, border-color 160ms ease;
}
.account__button:hover,
.account__button[aria-expanded="true"] {
	background: rgba(227,168,61,.06);
	border-color: rgba(227,168,61,.22);
}
.account__avatar {
	width: 36px;
	height: 36px;
	display: grid;
	place-items: center;
	border: 1px solid var(--line);
	border-radius: 50%;
	color: var(--gold-strong);
}
.account__avatar svg { width: 21px; height: 21px; }
.account__name { font-size: 14px; font-weight: 600; }
.account-menu {
	position: absolute;
	left: 14px;
	right: 14px;
	bottom: calc(100% - 1px);
	padding: 5px;
	border: 1px solid var(--soft-border);
	border-radius: 11px;
	background: rgba(10,10,11,.94);
	box-shadow: 0 -10px 34px rgba(0,0,0,.34);
	backdrop-filter: blur(16px);
	-webkit-backdrop-filter: blur(16px);
	transform-origin: bottom center;
	animation: accountMenuIn 150ms cubic-bezier(.2,.75,.2,1) both;
}
.account-menu[hidden] { display: none; }
.account-menu button {
	width: 100%;
	min-height: 42px;
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 0 11px;
	border: 0;
	border-radius: 8px;
	background: #000;
	cursor: pointer;
	text-align: left;
}
.account-menu button:hover { background: rgba(227,168,61,.08); }
.account-menu svg { width: 18px; height: 18px; color: var(--gold-strong); }

.sidebar-opener {
	position: absolute;
	left: 14px;
	top: 14px;
	width: 42px;
	height: 42px;
	display: grid;
	place-items: center;
	border: 1px solid var(--line);
	border-radius: 11px;
	background: rgba(10,10,11,.72);
	color: var(--gold-strong);
	backdrop-filter: blur(14px);
	cursor: pointer;
}
.sidebar-opener[hidden] { display: none; }

/* ---------------- RIGHT CHAT PANEL ---------------- */
.chat-panel {
	position: absolute;
	right: 20px;
	top: 20px;
	bottom: 102px;
	width: var(--chat-w);
	display: grid;
	grid-template-rows: auto 1fr;
	border: 1px solid var(--line);
	border-radius: 18px;
	background: linear-gradient(180deg, rgba(14,14,15,.78), rgba(10,10,11,.72));
	box-shadow: 0 18px 50px rgba(0,0,0,.22);
	backdrop-filter: blur(18px) saturate(110%);
	-webkit-backdrop-filter: blur(18px) saturate(110%);
	transform: translateX(0);
	opacity: 1;
	transition: transform 260ms cubic-bezier(.2,.75,.2,1), opacity 200ms ease;
}
.chat-panel.is-closed {
	transform: translateX(calc(100% + 40px));
	opacity: 0;
	pointer-events: none;
}
.panel-header {
	min-height: 72px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0 18px 0 22px;
	border-bottom: 1px solid rgba(255,255,255,.09);
}
.panel-header h1 { margin: 0; font-size: 26px; font-weight: 500; letter-spacing: -.02em; }
.chat-panel__messages {
	min-height: 0;
	overflow-y: auto;
	display: grid;
	align-content: start;
	gap: 16px;
	padding: 18px 18px 22px;
	scrollbar-width: thin;
	scrollbar-color: rgba(227,168,61,.35) transparent;
}
.message { display: flex; gap: 11px; align-items: flex-start; }
.message--user { justify-content: flex-end; }
.message__avatar {
	flex: 0 0 auto;
	width: 32px;
	height: 32px;
	margin-top: 2px;
	border: 1px solid var(--line);
	border-radius: 50%;
	background: radial-gradient(circle, rgba(255,202,100,.86) 0 22%, rgba(227,168,61,.12) 25% 100%);
	box-shadow: 0 0 14px rgba(227,168,61,.12);
}
.message__body { max-width: 78%; display: grid; gap: 6px; }
.message--user .message__body { justify-items: end; }
.message__bubble {
	border: 1px solid rgba(255,255,255,.12);
	border-radius: 14px;
	background: rgba(255,255,255,.035);
	padding: 11px 13px;
	font-size: 13px;
	line-height: 1.45;
	color: rgba(255,255,255,.86);
}
.message--user .message__bubble {
	border-color: var(--line);
	background: rgba(227,168,61,.095);
}
.message time { color: var(--muted); font-size: 10px; }
.message.is-new { animation: messageIn 220ms ease both; }

/* ---------------- BOTTOM DOCK ---------------- */
.bottom-dock {
	position: absolute;
	left: max(calc(var(--sidebar-w) + 26px), 26px);
	right: 26px;
	bottom: 18px;
	height: var(--dock-h);
	display: grid;
	grid-template-columns: 150px minmax(280px, 620px) 170px;
	justify-content: center;
	gap: 14px;
	align-items: center;
	transition: left 260ms cubic-bezier(.2,.75,.2,1);
}
body.sidebar-collapsed .bottom-dock { left: 26px; }
.dock-button,
.composer {
	height: 56px;
	border: 1px solid var(--line);
	border-radius: 14px;
	background: rgba(11,11,12,.68);
	box-shadow: 0 10px 30px rgba(0,0,0,.16);
	backdrop-filter: blur(16px) saturate(110%);
	-webkit-backdrop-filter: blur(16px) saturate(110%);
}
.dock-button {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	cursor: pointer;
}
.dock-button:hover { background: rgba(227,168,61,.08); }
.dock-button svg { width: 19px; height: 19px; color: var(--gold-strong); }

.composer {
	min-width: 0;
	display: grid;
	grid-template-columns: 1fr 46px 46px;
	align-items: center;
	padding: 4px 5px 4px 16px;
	background: transparent;
}
.composer input {
	min-width: 0;
	width: 100%;
	height: 100%;
	border: 0;
	outline: 0;
	background: transparent;
	color: var(--text);
	font-size: 14px;
}
.composer input::placeholder { color: rgba(255,255,255,.42); }
.composer__icon {
	width: 42px;
	height: 42px;
	display: grid;
	place-items: center;
	border: 0;
	border-radius: 11px;
	background: transparent;
	cursor: pointer;
	color: var(--gold-strong);
}
.composer__icon:hover { background: rgba(227,168,61,.08); }
.composer__send {
	border: 1px solid var(--line);
	border-radius: 50%;
	width: 40px;
	height: 40px;
}
.composer__chat.is-active { background: rgba(227,168,61,.11); }

@keyframes messageIn {
	from { opacity: 0; transform: translateY(5px); }
	to { opacity: 1; transform: none; }
}

@media (max-width: 1180px) {
	:root { --sidebar-w: 270px; }
	.bottom-dock {
		grid-template-columns: 122px minmax(240px, 1fr) 145px;
	}
}

@media (max-width: 900px) {
	:root { --sidebar-w: min(82vw, 300px); --chat-w: min(86vw, 390px); }
	.sidebar { z-index: 30; }
	.chat-panel { z-index: 28; }
	.bottom-dock {
		left: 14px !important;
		right: 14px;
		bottom: 12px;
		grid-template-columns: 52px minmax(0, 1fr) 52px;
		gap: 8px;
	}
	.dock-button--side { width: 52px; }
	.dock-button--side span { display: none; }
	.composer { grid-template-columns: 1fr 42px 42px; padding-left: 12px; }
}

/* ---------------- AVATAR EDITOR PANEL ---------------- */
.avatar-editor {
	position: absolute;
	right: 20px;
	top: 20px;
	bottom: 102px;
	width: min(520px, calc(100vw - 40px));
	display: grid;
	grid-template-rows: auto 1fr;
	border: 1px solid var(--line);
	border-radius: 18px;
	background: linear-gradient(180deg, rgba(14,14,15,.80), rgba(10,10,11,.74));
	box-shadow: 0 18px 50px rgba(0,0,0,.22);
	backdrop-filter: blur(18px) saturate(110%);
	-webkit-backdrop-filter: blur(18px) saturate(110%);
	transform: translateX(0);
	opacity: 1;
	transition: transform 260ms cubic-bezier(.2,.75,.2,1), opacity 200ms ease;
	overflow: hidden;
}
.avatar-editor.is-closed {
	transform: translateX(calc(100% + 40px));
	opacity: 0;
	pointer-events: none;
}
.panel-header {
	min-height: 72px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0 18px 0 22px;
	border-bottom: 1px solid rgba(255,255,255,.09);
}
.panel-header > div { display: grid; gap: 3px; }
.panel-header h1 { margin: 0; font-size: 26px; font-weight: 500; letter-spacing: -.02em; }
.panel-header p { margin: 0; color: var(--muted); font-size: 11px; }
.avatar-editor__body {
	min-height: 0;
	display: grid;
	grid-template-columns: 148px 1fr;
}
.avatar-tabs {
	min-height: 0;
	overflow-y: auto;
	padding: 12px 10px;
	border-right: 1px solid rgba(255,255,255,.08);
	display: grid;
	align-content: start;
	gap: 5px;
	scrollbar-width: thin;
	scrollbar-color: rgba(227,168,61,.28) transparent;
}
.avatar-tab {
	min-height: 43px;
	width: 100%;
	display: grid;
	grid-template-columns: 25px 1fr;
	align-items: center;
	gap: 8px;
	padding: 7px 9px;
	border: 1px solid transparent;
	border-radius: 10px;
	background: #000;
	text-align: left;
	color: rgba(255,255,255,.68);
	cursor: pointer;
	font-size: 12px;
	transition: color 150ms ease, background 150ms ease, border-color 150ms ease;
}
.avatar-tab:hover {
	color: #fff;
	background: rgba(227,168,61,.055);
	border-color: rgba(227,168,61,.16);
}
.avatar-tab.is-active {
	color: #fff;
	background: rgba(227,168,61,.085);
	border-color: rgba(227,168,61,.34);
}
.avatar-tab__icon {
	width: 24px;
	height: 24px;
	display: grid;
	place-items: center;
	border: 1px solid rgba(227,168,61,.38);
	border-radius: 7px;
	color: var(--gold-strong);
	font-size: 10px;
	font-weight: 700;
}
.avatar-editor__content {
	min-width: 0;
	min-height: 0;
	overflow-y: auto;
	padding: 18px;
	scrollbar-width: thin;
	scrollbar-color: rgba(227,168,61,.35) transparent;
}
.avatar-pane[hidden] { display: none; }
.avatar-pane { min-width: 0; }
.pane-heading { margin-bottom: 15px; }
.pane-heading h2 { margin: 0 0 5px; font-size: 17px; font-weight: 590; }
.pane-heading p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.4; }
.morph-list {
	display: grid;
	grid-template-columns: repeat(2, minmax(0,1fr));
	gap: 10px;
}
.morph-list:empty::before,
.asset-grid:empty::before {
	content: "Waiting for model data";
	grid-column: 1 / -1;
	min-height: 88px;
	display: grid;
	place-items: center;
	border: 1px dashed rgba(227,168,61,.24);
	border-radius: 12px;
	color: rgba(255,255,255,.34);
	font-size: 11px;
	letter-spacing: .02em;
}
.slider-card {
	min-width: 0;
	min-height: 74px;
	display: grid;
	align-content: center;
	gap: 10px;
	padding: 12px;
	border: 1px solid rgba(255,255,255,.10);
	border-radius: 11px;
	background: rgba(255,255,255,.026);
	transition: border-color 150ms ease, background 150ms ease;
}
.slider-card:hover {
	border-color: rgba(227,168,61,.30);
	background: rgba(227,168,61,.038);
}
.slider-card--wide { min-height: 72px; }
.slider-card__label {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	font-size: 11px;
	color: rgba(255,255,255,.78);
}
.morph-slider {
	--value: 50%;
	width: 100%;
	height: 18px;
	margin: 0;
	appearance: none;
	-webkit-appearance: none;
	background: #000;
	cursor: ew-resize;
}
.morph-slider::-webkit-slider-runnable-track {
	height: 3px;
	border-radius: 999px;
	background: linear-gradient(90deg, var(--gold) 0 var(--value), rgba(255,255,255,.14) var(--value) 100%);
}
.morph-slider::-webkit-slider-thumb {
	appearance: none;
	-webkit-appearance: none;
	width: 15px;
	height: 15px;
	margin-top: -6px;
	border: 1px solid #ffd98e;
	border-radius: 50%;
	background: #20170d;
	box-shadow: 0 0 0 3px rgba(227,168,61,.12), 0 0 10px rgba(227,168,61,.28);
}
.morph-slider::-moz-range-track {
	height: 3px;
	border-radius: 999px;
	background: rgba(255,255,255,.14);
}
.morph-slider::-moz-range-progress {
	height: 3px;
	border-radius: 999px;
	background: var(--gold);
}
.morph-slider::-moz-range-thumb {
	width: 15px;
	height: 15px;
	border: 1px solid #ffd98e;
	border-radius: 50%;
	background: #20170d;
	box-shadow: 0 0 0 3px rgba(227,168,61,.12), 0 0 10px rgba(227,168,61,.28);
}
.asset-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0,1fr));
	gap: 9px;
}
.asset-option {
	min-width: 0;
	aspect-ratio: 1 / 1.02;
	position: relative;
	display: grid;
	align-content: end;
	overflow: hidden;
	padding: 8px;
	border: 1px solid rgba(255,255,255,.10);
	border-radius: 11px;
	background: rgba(255,255,255,.026);
	cursor: pointer;
	transition: border-color 150ms ease, background 150ms ease, transform 150ms ease;
}
.asset-option:hover {
	border-color: rgba(227,168,61,.42);
	background: rgba(227,168,61,.05);
}
.asset-option.is-selected {
	border-color: var(--line);
	background: rgba(227,168,61,.075);
	box-shadow: inset 0 0 18px rgba(227,168,61,.035);
}
.asset-option__preview {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	opacity: .86;
}
.asset-option__fallback {
	position: absolute;
	inset: 0;
	display: grid;
	place-items: center;
	color: rgba(255,255,255,.26);
	font-size: 18px;
}
.asset-option__label {
	position: relative;
	z-index: 2;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	padding: 5px 6px;
	border-radius: 7px;
	background: rgba(0,0,0,.54);
	color: rgba(255,255,255,.83);
	font-size: 10px;
}
.hair-settings {
	display: grid;
	gap: 10px;
	margin-top: 14px;
}
.color-control {
	min-height: 50px;
	display: grid;
	grid-template-columns: 1fr 26px;
	align-items: center;
	gap: 10px;
	padding: 9px 11px;
	border: 1px solid rgba(255,255,255,.10);
	border-radius: 11px;
	background: rgba(255,255,255,.026);
	cursor: pointer;
	color: rgba(255,255,255,.78);
	font-size: 11px;
}
.color-control__preview {
	width: 24px;
	height: 24px;
	border: 1px solid rgba(255,255,255,.28);
	border-radius: 7px;
	background: #3a2417;
	box-shadow: 0 0 0 2px rgba(0,0,0,.18) inset;
}
.color-control input[type="color"] {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}
#editAvatarBtn.is-active { background: rgba(227,168,61,.11); }

@media (max-width: 900px) {
	.avatar-editor { z-index: 29; width: min(92vw, 520px); right: 10px; top: 10px; bottom: 86px; }
	.avatar-editor__body { grid-template-columns: 116px 1fr; }
	.avatar-tab { grid-template-columns: 21px 1fr; padding: 7px 6px; gap: 6px; font-size: 10px; }
	.avatar-tab__icon { width: 20px; height: 20px; border-radius: 6px; }
	.morph-list { grid-template-columns: 1fr; }
	.asset-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

/* Avatar editor icon rail — large golden category icons */
.avatar-editor__body {
	grid-template-columns: 132px 1fr;
}
.avatar-tabs {
	padding: 12px 9px;
	overflow-y: hidden;
	grid-template-rows: repeat(7, minmax(0, 1fr));
	align-content: stretch;
	gap: 6px;
}
.avatar-tab {
	min-height: 0;
	height: 100%;
	width: 100%;
	display: grid;
	grid-template-columns: 1fr;
	place-items: center;
	padding: 4px;
	border-radius: 12px;
	overflow: hidden;
}
.avatar-tab__image {
	width: min(88px, 88%);
	height: min(88px, 88%);
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
	object-position: center;
	pointer-events: none;
	user-select: none;
	filter: drop-shadow(0 0 7px rgba(227,168,61,.12));
	transition: transform 160ms ease, filter 160ms ease, opacity 160ms ease;
}
.avatar-tab:hover .avatar-tab__image {
	transform: scale(1.05);
	filter: drop-shadow(0 0 10px rgba(255,190,62,.34));
}
.avatar-tab.is-active .avatar-tab__image {
	transform: scale(1.07);
	filter: drop-shadow(0 0 13px rgba(255,190,62,.48));
}
.avatar-tab:not(.is-active) .avatar-tab__image {
	opacity: .78;
}
.avatar-tab.is-active {
	background: rgba(227,168,61,.075);
	border-color: rgba(227,168,61,.42);
}

@media (max-width: 900px) {
	.avatar-editor__body { grid-template-columns: 100px 1fr; }
	.avatar-tabs { padding: 10px 7px; gap: 5px; }
	.avatar-tab { padding: 3px; }
	.avatar-tab__image { width: min(70px, 88%); height: min(70px, 88%); }
}

/* ===== v4 golden icons refinement ===== */
.panel-header--avatar-editor {
	min-height: 76px;
}
/* Import/export UI hooks: buttons deliberately have no file handlers. */
.panel-header--avatar-editor .avatar-editor__header-actions {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 7px;
	flex: 0 0 auto;
}
#screen-chat .avatar-editor__header-actions .avatar-editor__transfer-button {
	color: var(--gold-strong);
	border-color: rgba(227, 168, 61, .28);
	background: rgba(227, 168, 61, .055);
}
.avatar-editor__header-actions .avatar-editor__transfer-button:hover {
	border-color: var(--line);
	background: rgba(227, 168, 61, .14);
}
.avatar-editor__header-actions .avatar-editor__transfer-button:focus-visible {
	outline: 2px solid var(--gold-strong);
	outline-offset: 2px;
}
@media (max-width: 430px) {
	.panel-header--avatar-editor { padding: 0 10px 0 14px; }
	.panel-header--avatar-editor .avatar-editor__header-actions { gap: 5px; }
	.panel-header--avatar-editor .avatar-editor__header-actions .icon-button { width: 32px; height: 32px; }
	#avatarEditorTitle { font-size: 21px; }
}
.panel-header__title-wrap {
	display: flex;
	align-items: center;
	min-width: 0;
}
#avatarEditorTitle {
	margin: 0;
	font-size: 28px;
	font-weight: 600;
	letter-spacing: -0.03em;
}

.pane-heading { display: none !important; }
.avatar-editor__content {
	padding: 16px 18px 18px;
}
.avatar-pane {
	min-height: 100%;
}
.morph-list,
.asset-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 14px;
}

.morph-list:empty::before,
.asset-grid:empty::before {
	content: none;
}

.slider-card,
.asset-option {
	min-width: 0;
	min-height: 0;
	aspect-ratio: auto;
	display: grid;
	gap: 10px;
	padding: 12px;
	border: 1px solid rgba(255,255,255,.10);
	border-radius: 14px;
	background: rgba(255,255,255,.026);
	transition: border-color 150ms ease, background 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}
.slider-card:hover,
.asset-option:hover {
	border-color: rgba(227,168,61,.32);
	background: rgba(227,168,61,.04);
}
.asset-option.is-selected,
.slider-card.is-selected {
	border-color: rgba(227,168,61,.42);
	background: rgba(227,168,61,.075);
	box-shadow: inset 0 0 18px rgba(227,168,61,.035);
}

.card-preview {
	position: relative;
	height: 112px;
	border: 1px solid rgba(227,168,61,.18);
	border-radius: 12px;
	background:
		radial-gradient(circle at 50% 25%, rgba(227,168,61,.12), rgba(227,168,61,0) 48%),
		linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.012));
	overflow: hidden;
}
.card-preview::before {
	content: "";
	position: absolute;
	inset: 12px;
	border: 1px dashed rgba(255,255,255,.08);
	border-radius: 10px;
}
.card-preview__badge {
	position: absolute;
	inset: 0;
	display: grid;
	place-items: center;
	color: rgba(227,168,61,.9);
	font-size: 28px;
	font-weight: 600;
	letter-spacing: -.02em;
	text-shadow: 0 0 12px rgba(227,168,61,.18);
}
.card-preview__img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	object-position: center;
	display: block;
	padding: 14px;
	opacity: .95;
	filter: drop-shadow(0 0 10px rgba(227,168,61,.18));
}

.slider-card__label,
.asset-option__label {
	position: static;
	z-index: auto;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	font-size: 11px;
	color: rgba(255,255,255,.83);
	padding: 0;
	background: #000;
	border-radius: 0;
}

.asset-option__fallback,
.asset-option__preview {
	position: static;
	inset: auto;
	width: auto;
	height: auto;
	opacity: 1;
}
.asset-option__fallback { display: none; }
.asset-option__preview { display: none; }

.slider-card__meta,
.asset-option__meta {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
}
.slider-card__value,
.asset-option__value {
	flex: 0 0 auto;
	font-size: 10px;
	color: var(--muted);
}

.morph-slider {
	height: 18px;
}
.morph-slider::-webkit-slider-thumb {
	border-radius: 5px;
	width: 16px;
	height: 16px;
	margin-top: -6px;
}
.morph-slider::-moz-range-thumb {
	border-radius: 5px;
	width: 16px;
	height: 16px;
}

.hair-settings {
	display: none !important;
}

@media (max-width: 900px) {
	.morph-list,
	.asset-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 10px;
	}
	.card-preview { height: 92px; }
	#avatarEditorTitle { font-size: 24px; }
}

/* ===== v3 fixed square editor cards ===== */
.morph-list,
.asset-grid {
	grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
	gap: 12px !important;
	align-items: start;
}

.slider-card,
.asset-option {
	box-sizing: border-box;
	width: 100%;
	aspect-ratio: 1 / 1 !important;
	min-width: 0;
	min-height: 0 !important;
	height: auto !important;
	max-height: none !important;
	padding: 10px !important;
	margin: 0;
	border-radius: 12px !important;
	overflow: hidden;
}

.slider-card {
	display: grid !important;
	grid-template-rows: minmax(0, 1fr) 20px;
	gap: 9px !important;
}

.asset-option {
	display: grid !important;
	grid-template-rows: minmax(0, 1fr);
	gap: 0 !important;
}

.asset-option--hair {
	grid-template-rows: minmax(0, 1fr) 50px;
	gap: 7px !important;
}

.card-preview {
	appearance: none;
	-webkit-appearance: none;
	box-sizing: border-box;
	position: relative;
	display: block;
	width: 100%;
	height: 100% !important;
	min-height: 0;
	margin: 0;
	padding: 0;
	border: 1px solid rgba(227,168,61,.20);
	border-radius: 10px;
	overflow: hidden;
	cursor: pointer;
	background:
		radial-gradient(circle at 50% 35%, rgba(227,168,61,.13), rgba(227,168,61,0) 48%),
		linear-gradient(180deg, rgba(255,255,255,.025), rgba(255,255,255,.010));
}
.card-preview:hover {
	border-color: rgba(227,168,61,.42);
}
.card-preview::before {
	content: "";
	position: absolute;
	inset: 10px;
	border: 1px solid rgba(255,255,255,.055);
	border-radius: 8px;
	pointer-events: none;
}

.card-preview__img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	padding: 10px;
	object-fit: contain;
	object-position: center;
	opacity: .96;
	pointer-events: none;
}

/* No visible names or numeric values inside editor cards. */
.slider-card__meta,
.asset-option__meta,
.slider-card__label,
.asset-option__label,
.slider-card__value,
.asset-option__value,
.card-preview__badge {
	display: none !important;
}

.morph-slider {
	display: block;
	width: 100%;
	height: 20px !important;
	min-height: 20px;
	margin: 0;
	align-self: end;
	flex: none;
}

/* Hair: slider first, then a small square color button below it. */
.hair-card__controls {
	min-height: 0;
	display: grid;
	grid-template-rows: 18px 26px;
	gap: 5px;
	align-content: end;
}
.hair-card__controls .morph-slider {
	height: 18px !important;
	min-height: 18px;
}
.hair-color-swatch {
	--swatch-color: #7a4b18;
	position: relative;
	width: 26px;
	height: 26px;
	display: block;
	justify-self: center;
	border: 1px solid rgba(255,217,142,.72);
	border-radius: 6px;
	background:
		linear-gradient(135deg, rgba(255,255,255,.24), transparent 38%),
		var(--swatch-color);
	box-shadow:
		inset 0 0 0 1px rgba(0,0,0,.16),
		0 0 10px rgba(227,168,61,.18);
	cursor: pointer;
	transition: transform 120ms ease, box-shadow 120ms ease;
}
.hair-color-swatch:hover {
	transform: scale(1.07);
	box-shadow:
		inset 0 0 0 1px rgba(0,0,0,.12),
		0 0 14px rgba(227,168,61,.32);
}
.hair-color-swatch input[type="color"] {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	opacity: 0;
	cursor: pointer;
}

/* Clothing, suits and shoes intentionally have no slider/color controls. */
.asset-option:not(.asset-option--hair) .morph-slider,
.asset-option:not(.asset-option--hair) .hair-color-swatch {
	display: none !important;
}

/* Slider movement changes only the value; it can never alter card geometry. */
.slider-card,
.asset-option,
.card-preview,
.hair-card__controls {
	contain: layout paint;
}

@media (max-width: 900px) {
	.morph-list,
	.asset-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
		gap: 8px !important;
	}
	.slider-card,
	.asset-option {
		padding: 7px !important;
		border-radius: 10px !important;
	}
	.asset-option--hair {
		grid-template-rows: minmax(0, 1fr) 45px;
	}
	.hair-card__controls {
		grid-template-rows: 16px 24px;
		gap: 4px;
	}
	.hair-color-swatch {
		width: 24px;
		height: 24px;
	}
}

/* ===== v4 preview geometry fix =====
		Outer editor card may be rectangular.
		The image/preview window is always a strict square (1:1).
		Internal spacing is intentionally tight: 3px. */
.morph-list,
.asset-grid {
	align-items: start !important;
}

.slider-card,
.asset-option {
	aspect-ratio: auto !important;
	height: auto !important;
	min-height: 0 !important;
	padding: 3px !important;
	gap: 3px !important;
	overflow: visible;
}

.slider-card {
	grid-template-rows: auto 20px !important;
}

.asset-option {
	grid-template-rows: auto !important;
}

.asset-option--hair {
	grid-template-rows: auto auto !important;
}

.card-preview {
	box-sizing: border-box;
	width: 100% !important;
	height: auto !important;
	min-height: 0 !important;
	aspect-ratio: 1 / 1 !important;
	flex: 0 0 auto;
	margin: 0 !important;
	padding: 0 !important;
	border-radius: 9px;
}

.card-preview::before {
	inset: 3px !important;
	border-radius: 7px;
}

.card-preview__img {
	padding: 3px !important;
}

.morph-slider {
	width: 100%;
	margin: 0 !important;
}

.hair-card__controls {
	grid-template-rows: 18px 26px !important;
	gap: 3px !important;
	padding: 0 !important;
	margin: 0 !important;
}

.hair-color-swatch {
	margin: 0 !important;
}

@media (max-width: 900px) {
	.slider-card,
	.asset-option {
		padding: 3px !important;
		gap: 3px !important;
	}
	.card-preview::before {
		inset: 3px !important;
	}
}

/* ============================================================
	AUTH
	============================================================ */

/* ---------------- AUTH SCREEN VARIABLES ---------------- */
#screen-auth {

	--ink: #0c1f4c;
	--muted: #6178a5;
	--blue: #147df4;
	--blue-2: #1d97f8;
	--panel: rgba(239, 247, 255, 0.82);
	--panel-strong: rgba(248, 252, 255, 0.92);
	--line: rgba(255, 255, 255, 0.86);
	--shadow: 0 24px 70px rgba(22, 79, 135, 0.18), 0 6px 24px rgba(22, 79, 135, 0.12);

	font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
	color: var(--ink);
	background: #7bbff5;
}

/* ---------------- AUTH SCREEN (design preserved) ---------------- */

.hero {
	position: relative;
	min-height: 100svh;
	height: 100vh;
	isolation: isolate;
	overflow: hidden;
}

.hero__background {
	position: absolute;
	inset: 0;
	z-index: -3;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center center;
	user-select: none;
	pointer-events: none;
}

.hero__veil {
	position: absolute;
	inset: 0;
	z-index: -2;
	pointer-events: none;
	background: none;
}

.auth-card {
	position: absolute;
	top: 25.2%;
	left: clamp(52px, 16.1vw, 270px);
	width: clamp(390px, 24vw, 420px);
	overflow: hidden;
	border: 1px solid var(--line);
	border-radius: 27px;
	background: var(--panel);
	box-shadow: var(--shadow);
	backdrop-filter: blur(24px) saturate(125%);
	-webkit-backdrop-filter: blur(24px) saturate(125%);
}

.auth-tabs {
	display: grid;
	grid-template-columns: 1fr 1fr;
	height: 64px;
	background: rgba(230, 242, 254, 0.56);
	border-bottom: 1px solid rgba(107, 143, 188, 0.15);
}

.auth-tab {
	position: relative;
	display: grid;
	place-items: center;
	border: 0;
	padding: 0;
	color: rgba(67, 93, 143, 0.75);
	font: inherit;
	background: transparent;
	cursor: pointer;
	font-size: 18px;
	font-weight: 650;
	user-select: none;
	transition: color 160ms ease, background 160ms ease;
}

.auth-tab + .auth-tab {
	border-left: 1px solid rgba(107, 143, 188, 0.12);
}

.auth-tab::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: -1px;
	height: 3px;
	opacity: 0;
	transform: scaleX(0.55);
	background: linear-gradient(90deg, #3a82e6, #086df0);
	transition: opacity 160ms ease, transform 160ms ease;
}

.auth-tab.active {
	color: #0b2b6e;
	background: rgba(255, 255, 255, 0.2);
}

.auth-tab.active::after {
	opacity: 1;
	transform: scaleX(1);
}

.auth-tab:focus-visible,
.primary-button:focus-visible,
.field:focus-within {
	outline: 3px solid rgba(24, 127, 244, 0.22);
	outline-offset: 2px;
}

.auth-panel {
	display: none;
}

/* Default state: Sign In. */
.auth-panel--signin {
	display: block;
}

/*
	The tab controller only has to move the .active class between the two tabs.
	The matching form panel follows that active state automatically.
*/
.auth-tabs:has(.auth-tab--signin.active) + .auth-card__body .auth-panel--signin {
	display: block;
}

.auth-tabs:has(.auth-tab--signin.active) + .auth-card__body .auth-panel--signup {
	display: none;
}

.auth-tabs:has(.auth-tab--signup.active) + .auth-card__body .auth-panel--signin {
	display: none;
}

.auth-tabs:has(.auth-tab--signup.active) + .auth-card__body .auth-panel--signup {
	display: block;
}

.auth-card__body {
	padding: 26px 28px 29px;
}

.auth-copy h1 {
	margin: 0;
	font-size: clamp(29px, 2.05vw, 34px);
	line-height: 1.08;
	letter-spacing: -0.035em;
	font-weight: 760;
	color: #0a1b47;
}

.auth-copy p {
	margin: 10px 0 22px;
	color: var(--muted);
	font-size: 15px;
	line-height: 1.45;
}

.auth-form {
	display: grid;
	gap: 12px;
}

.field {
	position: relative;
	display: grid;
	grid-template-columns: 34px 1fr;
	align-items: center;
	min-height: 56px;
	padding: 0 15px 0 16px;
	border: 1px solid rgba(106, 143, 190, 0.16);
	border-radius: 16px;
	background: var(--panel-strong);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
	color: #506ea7;
	transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.field:focus-within {
	border-color: rgba(30, 128, 240, 0.38);
	background: rgba(255, 255, 255, 0.96);
	box-shadow: 0 0 0 4px rgba(31, 132, 246, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.field__icon {
	display: grid;
	place-items: center;
	width: 24px;
	height: 24px;
	color: #5472ab;
}

.field__icon svg {
	width: 22px;
	height: 22px;
}

.field input {
	width: 100%;
	min-width: 0;
	padding: 0;
	border: 0;
	outline: 0;
	background: transparent;
	color: #163264;
	font-size: 15px;
	line-height: 1;
}

.field input::placeholder {
	color: #677da9;
	opacity: 0.95;
}

.form-message {
	min-height: 0;
	margin: -2px 2px 0;
	color: #c63d4a;
	font-size: 12.5px;
	line-height: 1.35;
}

.form-message:empty {
	display: none;
}

.form-message.is-success {
	color: #176f5b;
}

.primary-button {
	min-height: 57px;
	margin-top: 1px;
	border: 0;
	border-radius: 15px;
	color: #fff;
	background: linear-gradient(135deg, var(--blue-2), var(--blue));
	box-shadow: 0 12px 28px rgba(20, 125, 244, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.25);
	cursor: pointer;
	font-size: 18px;
	font-weight: 700;
	transition: transform 120ms ease, filter 120ms ease, box-shadow 120ms ease;
}

.primary-button:hover {
	filter: brightness(1.035);
	box-shadow: 0 14px 32px rgba(20, 125, 244, 0.27), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.primary-button:active {
	transform: translateY(1px) scale(0.997);
}

.sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

@media (min-width: 1440px) and (max-height: 980px) {
	.auth-card {
		top: 25.2%;
	}
}

@media (max-width: 1180px) {
	.auth-card {
		left: clamp(34px, 7vw, 80px);
		width: min(390px, 38vw);
	}

	.auth-card__body {
		padding: 24px;
	}
}

@media (max-width: 760px) {
	.hero {
		min-height: 760px;
	}

	.hero__background {
		object-position: 61% center;
	}

	.hero__veil {
		background: none;
	}

	.auth-card {
		top: auto;
		left: 50%;
		bottom: 26px;
		width: min(92vw, 420px);
		transform: translateX(-50%);
		border-radius: 24px;
	}

	.auth-tabs {
		height: 58px;
	}

	.auth-card__body {
		padding: 22px;
	}

	.auth-copy h1 {
		font-size: 30px;
	}
}

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

/* Password reset UI — additive only; existing HEROT design rules stay unchanged. */
#screen-auth .auth-card[data-auth-view="forgot"] .auth-card__body .auth-panel--signin,
#screen-auth .auth-card[data-auth-view="forgot"] .auth-card__body .auth-panel--signup {
	display: none;
}

#screen-auth .auth-card[data-auth-view="forgot"] .auth-card__body .auth-panel--forgot {
	display: block;
}

.auth-password-link {
	justify-self: end;
	margin: 1px 3px 0;
	padding: 2px 0;
	border: 0;
	background: none;
	color: var(--blue, #187ff4);
	font: inherit;
	font-size: 13px;
	cursor: pointer;
}

.auth-password-link:hover,
.auth-password-link:focus-visible {
	text-decoration: underline;
}


/* Upper Clothes: equal-width Out / In switches above independent asset grids. */
#screen-chat .upper-clothes__tabs {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	width: 100%;
	height: 38px;
	margin: 0 0 13px;
	padding: 2px;
	gap: 3px;
	border: 1px solid rgba(227, 168, 61, .38);
	border-radius: 9px;
	background: rgba(13, 12, 13, .55);
}
#screen-chat .upper-clothes__tab {
	min-width: 0;
	border: 1px solid transparent;
	border-radius: 6px;
	background: transparent;
	color: rgba(243, 240, 234, .74);
	font: inherit;
	font-size: 13px;
	font-weight: 650;
	letter-spacing: .035em;
	cursor: pointer;
	transition: background 150ms ease, color 150ms ease, border-color 150ms ease;
}
#screen-chat .upper-clothes__tab:hover {
	color: var(--gold-strong);
	background: rgba(227, 168, 61, .08);
}
#screen-chat .upper-clothes__tab.is-active {
	color: var(--gold-strong);
	border-color: rgba(227, 168, 61, .40);
	background: rgba(227, 168, 61, .14);
}
#screen-chat .upper-clothes__tab:focus-visible {
	outline: 2px solid var(--gold-strong);
	outline-offset: -2px;
}
#screen-chat .upper-clothes__panel[hidden] { display: none !important; }


/* Editable text field between the Avatar Editor title and header actions. */
.panel-header--avatar-editor {
	gap: 10px;
}
.panel-header--avatar-editor .panel-header__title-wrap {
	flex: 0 1 auto;
	min-width: 0;
}
.panel-header--avatar-editor #avatarEditorTitle {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
#screen-chat .avatar-editor__header-input {
	box-sizing: border-box;
	flex: 1 1 170px;
	width: 100%;
	max-width: 185px;
	min-width: 0;
	height: 38px;
	padding: 0 11px;
	border: 1px solid rgba(227,168,61,.35);
	border-radius: 9px;
	outline: none;
	background: rgba(9,9,10,.42);
	color: var(--text);
	font: inherit;
	font-size: 13px;
}
#screen-chat .avatar-editor__header-input::placeholder {
	color: rgba(243,240,234,.40);
}
#screen-chat .avatar-editor__header-input:focus-visible {
	border-color: var(--gold-strong);
	box-shadow: 0 0 0 2px rgba(227,168,61,.12);
}
@media (max-width: 520px) {
	.panel-header--avatar-editor { gap: 6px; }
	.panel-header--avatar-editor #avatarEditorTitle { font-size: 21px; }
	#screen-chat .avatar-editor__header-input { height: 32px; padding: 0 6px; font-size: 11px; }
}


/* ============================================================
   Chat extras — live history search, account settings and mic
   ============================================================ */
#screen-chat .hero-overlay[hidden] { display: none !important; }
#screen-chat .hero-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  pointer-events: auto;
}
#screen-chat .hero-overlay__scrim {
  position: absolute;
  inset: 0;
  background: rgba(2, 4, 9, .77);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
#screen-chat .hero-dialog {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  width: min(760px, calc(100vw - 32px));
  max-height: min(78dvh, 740px);
  overflow: hidden;
  border: 1px solid rgba(234, 179, 77, .53);
  border-radius: 22px;
  background: linear-gradient(145deg, rgba(34,30,27,.97), rgba(12,13,17,.98) 65%, rgba(16,18,26,.98));
  color: #f5f0e7;
  box-shadow: 0 32px 110px rgba(0,0,0,.65), inset 0 1px rgba(255,213,131,.14), 0 0 50px rgba(239,168,46,.09);
  animation: heroDialogAppear 170ms cubic-bezier(.2,.78,.22,1) both;
  pointer-events: auto;
}
#screen-chat .hero-dialog--settings { width: min(540px, calc(100vw - 32px)); }
#screen-chat .hero-dialog__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 26px 30px 18px;
  border-bottom: 1px solid rgba(250,214,147,.12);
}
#screen-chat .hero-dialog__eyebrow {
  margin: 0 0 5px;
  color: #d6a757;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .22em;
}
#screen-chat .hero-dialog__header h2 {
  margin: 0;
  font-size: clamp(24px, 3.5vw, 31px);
  line-height: 1.18;
  font-weight: 650;
  letter-spacing: -.045em;
}
#screen-chat .hero-dialog__close {
  flex: 0 0 40px;
  height: 40px;
  padding: 0;
  border: 1px solid rgba(245,220,166,.22);
  border-radius: 12px;
  background: rgba(255,255,255,.035);
  color: #f7e5b7;
  font-size: 27px;
  line-height: 1;
  cursor: pointer;
}
#screen-chat .hero-dialog__close:hover { border-color: #f2bd65; background: rgba(242,189,101,.11); }
#screen-chat .hero-dialog__close:focus-visible,
#screen-chat .hero-search-field:focus-within,
#screen-chat .hero-search-result:focus-visible,
#screen-chat .hero-settings-logout:focus-visible {
  outline: 2px solid #f2bd65;
  outline-offset: 2px;
}
#screen-chat .hero-search-field {
  display: flex;
  align-items: center;
  gap: 13px;
  margin: 22px 30px 10px;
  padding: 0 16px;
  height: 58px;
  min-height: 58px;
  border: 1px solid rgba(240,181,79,.38);
  border-radius: 14px;
  background: rgba(4,6,11,.68);
  box-shadow: inset 0 0 15px rgba(223,155,50,.05);
}
#screen-chat .hero-search-field svg,
#screen-chat .hero-search-result__icon svg,
#screen-chat .hero-settings-profile__avatar svg {
  flex: 0 0 auto;
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
#screen-chat .hero-search-field svg { color: #e8b759; }
#screen-chat .hero-search-field input {
  flex: 1;
  min-width: 0;
  width: 100%;
  height: 100%;
  border: 0;
  outline: none;
  background: transparent;
  color: #fff5df;
  font: inherit;
  font-size: 16px;
}
#screen-chat .hero-search-field input::placeholder { color: rgba(246,237,219,.45); }
#screen-chat .hero-search-field kbd {
  padding: 3px 7px;
  border: 1px solid rgba(255,255,255,.17);
  border-radius: 6px;
  color: rgba(255,255,255,.5);
  font-size: 10px;
  font-family: inherit;
}
#screen-chat .hero-search-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 32px 13px;
  color: rgba(245,237,224,.53);
  font-size: 12px;
}
#screen-chat .hero-search-results {
  min-height: 148px;
  max-height: min(47dvh, 430px);
  overflow-y: auto;
  padding: 0 22px 25px;
  scrollbar-color: rgba(226,169,65,.4) transparent;
  scrollbar-width: thin;
}
#screen-chat .hero-search-result {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  min-height: 68px;
  padding: 13px 17px;
  border: 1px solid transparent;
  border-radius: 13px;
  background: transparent;
  color: rgba(252,248,238,.9);
  text-align: left;
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease;
}
#screen-chat .hero-search-result + .hero-search-result { margin-top: 4px; }
#screen-chat .hero-search-result:hover, #screen-chat .hero-search-result.is-current {
  border-color: rgba(230,174,84,.32);
  background: rgba(224,169,75,.085);
}
#screen-chat .hero-search-result__icon {
  display: grid;
  flex: 0 0 41px;
  height: 41px;
  place-items: center;
  border: 1px solid rgba(228,177,86,.26);
  border-radius: 11px;
  color: #f5c36a;
  background: rgba(228,171,71,.07);
}
#screen-chat .hero-search-result__text { display: grid; min-width: 0; gap: 4px; flex: 1; }
#screen-chat .hero-search-result__text strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
  font-weight: 570;
}
#screen-chat .hero-search-result__text small { font-size: 12px; color: rgba(244,238,224,.52); }
#screen-chat .hero-search-result__arrow { color: #e6b566; font-size: 22px; }
#screen-chat .hero-search-empty {
  margin: 32px auto;
  padding: 20px;
  color: rgba(245,239,225,.55);
  text-align: center;
  font-size: 14px;
}
#screen-chat .hero-settings-body {
  display: grid;
  gap: 23px;
  padding: 22px 29px 31px;
  overflow-y: auto;
}
#screen-chat .hero-settings-profile {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  padding: 13px;
  border: 1px solid rgba(225,171,85,.18);
  border-radius: 15px;
  background: rgba(242,205,137,.045);
}
#screen-chat .hero-settings-profile__avatar {
  flex: 0 0 51px;
  width: 51px;
  height: 51px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 2px solid #d5a354;
  border-radius: 50%;
  background: #1e1a16;
  color: #f8d493;
}
#screen-chat .hero-settings-profile__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
#screen-chat .hero-settings-profile__avatar [hidden] { display: none !important; }
#screen-chat .hero-settings-profile__info { min-width: 0; display: grid; gap: 4px; flex: 1; }
#screen-chat .hero-settings-profile__info strong, #screen-chat .hero-settings-profile__info span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#screen-chat .hero-settings-profile__info strong { font-size: 15px; }
#screen-chat .hero-settings-profile__info span { color: rgba(245,238,223,.54); font-size: 12px; }
#screen-chat .hero-settings-logout {
  flex: 0 0 auto;
  min-height: 35px;
  padding: 0 12px;
  border: 1px solid rgba(232,177,87,.48);
  border-radius: 9px;
  background: rgba(226,155,55,.08);
  color: #f5c778;
  cursor: pointer;
  font-size: 12px;
}
#screen-chat .hero-settings-logout:hover { background: rgba(232,177,87,.17); }
#screen-chat .hero-settings-group {
  padding: 17px 19px 20px;
  border: 1px solid rgba(225,171,85,.17);
  border-radius: 15px;
  background: rgba(0,0,0,.20);
}
#screen-chat .hero-settings-row {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 15px;
  margin-bottom: 21px;
}
#screen-chat .hero-settings-row h3 { margin: 0 0 4px; font-size: 16px; font-weight: 600; }
#screen-chat .hero-settings-row p { margin: 0; color: rgba(244,235,222,.54); font-size: 12px; }
#screen-chat .hero-settings-row output {
  color: #ffd18b;
  font-size: 13px;
  font-weight: 650;
  text-align: right;
}
#screen-chat .hero-settings-range {
  display: block;
  width: 100%;
  height: 7px;
  margin: 0 0 12px;
  appearance: none;
  -webkit-appearance: none;
  outline-offset: 6px;
  border-radius: 99px;
  background: linear-gradient(90deg, #f1b45b 0 var(--range-progress, 0%), rgba(255,255,255,.18) var(--range-progress,0%) 100%);
  cursor: pointer;
  accent-color: #eebb69;
}
#screen-chat .hero-settings-range::-webkit-slider-thumb {
  width: 20px;
  height: 20px;
  appearance: none;
  -webkit-appearance: none;
  border: 3px solid #ffe5b0;
  border-radius: 50%;
  background: #99601e;
  box-shadow: 0 0 12px rgba(241,179,80,.45);
}
#screen-chat .hero-settings-range::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border: 3px solid #ffe5b0;
  border-radius: 50%;
  background: #99601e;
  box-shadow: 0 0 12px rgba(241,179,80,.45);
}
#screen-chat .hero-settings-ticks {
  display: flex;
  justify-content: space-between;
  color: rgba(245,235,221,.63);
  font-size: 11px;
}
#screen-chat .composer {
  grid-template-columns: minmax(0, 1fr) 42px 46px 46px;
  gap: 1px;
}
#screen-chat .composer__mic { color: #f9d193; }
#screen-chat .composer__mic.is-active, #screen-chat .composer__mic[aria-pressed="true"] {
  color: #ffe9c4;
  background: rgba(237,127,94,.16);
  box-shadow: inset 0 0 0 1px rgba(239,148,106,.4);
}
#screen-chat #messageInput, #screen-chat #messageInput::placeholder,
#screen-chat .message__bubble {
  text-shadow: 0 1px 2px rgba(0,0,0,.58), 0 0 5px rgba(0,0,0,.5);
}
@media (max-width: 600px) {
  #screen-chat .hero-overlay { padding: 8px; }
  #screen-chat .hero-dialog { width: calc(100vw - 16px); max-height: 86dvh; border-radius: 16px; }
  #screen-chat .hero-dialog__header { padding: 18px 18px 14px; }
  #screen-chat .hero-search-field { margin: 15px 15px 8px; }
  #screen-chat .hero-search-meta { padding: 8px 18px 12px; }
  #screen-chat .hero-search-results { padding: 0 10px 16px; }
  #screen-chat .hero-settings-body { padding: 16px; gap: 15px; }
  #screen-chat .hero-settings-profile { flex-wrap: wrap; }
  #screen-chat .composer { grid-template-columns: minmax(0, 1fr) 38px 40px 40px; gap: 0; }
  #screen-chat .composer__mic { width: 38px; }
}
@media (prefers-reduced-motion: reduce) {
  #screen-chat .hero-dialog { animation: none; }
}
@keyframes heroDialogAppear {
  from { opacity: 0; transform: translateY(11px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}


/* Saved-only account preferences, gold greeting checkbox and compact voice language. */
#screen-chat .hero-settings-row--greeting {
  align-items: center;
  margin-bottom: 0;
}
#screen-chat .hero-settings-row--greeting > div {
  min-width: 0;
}
#screen-chat .hero-settings-check {
  flex: 0 0 auto;
  width: 46px;
  height: 40px;
  display: grid;
  place-items: center;
  cursor: pointer;
}
#screen-chat .hero-settings-check input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}
#screen-chat .hero-settings-check__box {
  width: 29px;
  height: 29px;
  display: grid;
  place-items: center;
  border: 2px solid rgba(245,192,102,.62);
  border-radius: 8px;
  background: rgba(231,169,69,.04);
  color: transparent;
  box-shadow: inset 0 0 10px rgba(0,0,0,.2);
  transition: background 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}
#screen-chat .hero-settings-check__box svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 3.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
#screen-chat .hero-settings-check input:checked + .hero-settings-check__box {
  color: #1d1308;
  border-color: #ffe1a0;
  background: linear-gradient(145deg,#fff0bb,#e9b45e 70%,#bd7e27);
  box-shadow: 0 0 14px rgba(233,178,78,.23), inset 0 1px rgba(255,255,255,.48);
}
#screen-chat .hero-settings-check input:focus-visible + .hero-settings-check__box {
  outline: 2px solid #fff0b3;
  outline-offset: 3px;
}
#screen-chat .hero-settings-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 14px;
  padding: 2px 0 0;
  min-height: 43px;
}
#screen-chat .hero-settings-status {
  flex: 1;
  color: #e7c68b;
  font-size: 12px;
  line-height: 1.4;
  text-align: right;
}
#screen-chat .hero-settings-save {
  min-width: 154px;
  min-height: 43px;
  padding: 0 19px;
  border: 1px solid #fff0b4;
  border-radius: 11px;
  background: linear-gradient(145deg,#f8d28d,#dc9f44);
  box-shadow: 0 5px 18px rgba(218,152,51,.22), inset 0 1px rgba(255,255,255,.32);
  color: #211609;
  font: inherit;
  font-size: 13px;
  font-weight: 740;
  cursor: pointer;
  white-space: nowrap;
  transition: filter 160ms ease, transform 160ms ease;
}
#screen-chat .hero-settings-save:hover { filter: brightness(1.09); }
#screen-chat .hero-settings-save:active { transform: translateY(1px); }
#screen-chat .hero-settings-save:focus-visible {
  outline: 2px solid #ffe4a3;
  outline-offset: 3px;
}
#screen-chat .composer {
  grid-template-columns: minmax(0,1fr) 80px 42px 46px 46px;
  gap: 1px;
}
#screen-chat .composer__language {
  position: relative;
  align-self: center;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  height: 34px;
  border: 1px solid rgba(237,183,87,.35);
  border-radius: 9px;
  background: rgba(25,20,15,.26);
}
#screen-chat .composer__language::after {
  content: "";
  position: absolute;
  pointer-events: none;
  right: 8px;
  top: 12px;
  width: 5px;
  height: 5px;
  border-right: 1.5px solid #ecc47f;
  border-bottom: 1.5px solid #ecc47f;
  transform: rotate(45deg);
}
#screen-chat .composer__language:focus-within {
  border-color: #f5cc81;
  box-shadow: 0 0 0 2px rgba(225,173,82,.13);
}
#screen-chat .composer__language select {
  appearance: none;
  -webkit-appearance: none;
  min-width: 0;
  width: 100%;
  height: 100%;
  padding: 0 17px 0 7px;
  border: 0;
  outline: 0;
  border-radius: inherit;
  background: transparent;
  color: #f6dbac;
  font: inherit;
  font-size: 10px;
  font-weight: 620;
  cursor: pointer;
}
#screen-chat .composer__language option {
  color: #fff4df;
  background: #211a13;
}
@media (max-width:600px) {
  #screen-chat .composer { grid-template-columns: minmax(0,1fr) 67px 38px 40px 40px; gap: 0; }
  #screen-chat .composer__language select { font-size: 10px; padding-left: 5px; }
  #screen-chat .hero-settings-footer { flex-wrap: wrap; }
  #screen-chat .hero-settings-status { min-width: 100px; }
}
@media (max-width:390px) {
  #screen-chat .composer { grid-template-columns: minmax(0,1fr) 58px 36px 38px 38px; }
  #screen-chat .composer__language::after { right: 5px; }
  #screen-chat .composer__language select { padding-right: 11px; font-size: 9px; }
}


/* =============================================================
   Reusable Confirm / Deny dialog — appears above chat/search/settings
   ============================================================= */
#screen-chat .hero-confirm-overlay {
  z-index: 150;
}
#screen-chat .hero-confirm-overlay[hidden] {
  display: none !important;
}
/* Keep the animated scene visible instead of darkening and blurring it heavily. */
#screen-chat .hero-confirm-overlay .hero-overlay__scrim {
  background: rgba(2, 4, 9, .35);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
#screen-chat .hero-dialog--confirm {
  width: min(370px, calc(100vw - 32px));
  max-height: 80dvh;
  align-items: center;
  padding: 23px 24px 22px;
  text-align: center;
}
#screen-chat .hero-confirm__ornament {
  display: grid;
  place-items: center;
  width: 43px;
  height: 43px;
  margin-bottom: 10px;
  border: 1px solid rgba(237,189,104,.36);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(235,168,58,.10), rgba(210,145,52,.035));
  color: #ffd78f;
  box-shadow: 0 0 23px rgba(216,151,55,.11);
}
#screen-chat .hero-confirm__ornament svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
#screen-chat .hero-dialog--confirm h2 {
  max-width: 100%;
  margin: 8px 0 0;
  color: #fff5e7;
  font-size: clamp(19px, 3vw, 23px);
  font-weight: 670;
  line-height: 1.24;
  overflow-wrap: anywhere;
}
#screen-chat .hero-confirm__message {
  width: 100%;
  margin: 10px 0 19px;
  color: rgba(249,240,225,.72);
  font-size: 13px;
  line-height: 1.65;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
#screen-chat .hero-confirm__actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
  width: 100%;
}
#screen-chat .hero-confirm__button {
  min-width: 0;
  min-height: 40px;
  padding: 8px 12px;
  border-radius: 11px;
  font: inherit;
  font-size: 14px;
  font-weight: 680;
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease, filter 150ms ease;
}
#screen-chat .hero-confirm__button--deny {
  border: 1px solid rgba(245,216,161,.28);
  background: rgba(255,255,255,.045);
  color: #f1e5d2;
}
#screen-chat .hero-confirm__button--deny:hover {
  background: rgba(255,255,255,.10);
  border-color: rgba(245,216,161,.56);
}
#screen-chat .hero-confirm__button--accept {
  border: 1px solid #f5d18c;
  background: linear-gradient(135deg, #f9d89b, #dd9e42);
  box-shadow: 0 5px 19px rgba(224,158,62,.18);
  color: #211404;
}
#screen-chat .hero-confirm__button--accept:hover {
  filter: brightness(1.10);
}
#screen-chat .hero-confirm-overlay.is-danger .hero-confirm__ornament {
  border-color: rgba(242,132,114,.34);
  color: #f1a48e;
  background: rgba(188,74,57,.11);
  box-shadow: 0 0 23px rgba(188,74,57,.09);
}
#screen-chat .hero-confirm-overlay.is-danger .hero-confirm__button--accept {
  border-color: #ffb09c;
  background: linear-gradient(135deg, #f5b09a, #cc664b);
  color: #240a05;
  box-shadow: 0 5px 19px rgba(204,102,75,.20);
}
#screen-chat .hero-confirm__button:focus-visible {
  outline: 2px solid #f7cd83;
  outline-offset: 3px;
}
@media (max-width: 500px) {
  #screen-chat .hero-dialog--confirm { padding: 21px 18px 20px; }
  #screen-chat .hero-confirm__actions { gap: 8px; }
}


/* Compact Account Settings: show all controls and Save Settings without a desktop scrollbar. */
#screen-chat .hero-dialog--settings {
  max-height: min(92dvh, 750px);
}
#screen-chat .hero-dialog--settings .hero-dialog__header {
  flex: 0 0 auto;
  padding: 17px 23px 13px;
}
#screen-chat .hero-dialog--settings .hero-dialog__header h2 {
  font-size: clamp(23px, 3vw, 27px);
}
#screen-chat .hero-dialog--settings .hero-dialog__close {
  flex-basis: 36px;
  height: 36px;
}
#screen-chat .hero-dialog--settings .hero-settings-body {
  gap: 11px;
  padding: 14px 22px 17px;
  overflow-y: visible;
}
#screen-chat .hero-dialog--settings .hero-settings-profile {
  gap: 11px;
  padding: 9px 12px;
}
#screen-chat .hero-dialog--settings .hero-settings-profile__avatar {
  flex-basis: 42px;
  width: 42px;
  height: 42px;
}
#screen-chat .hero-dialog--settings .hero-settings-group {
  padding: 12px 15px 13px;
}
#screen-chat .hero-dialog--settings .hero-settings-row {
  margin-bottom: 12px;
}
#screen-chat .hero-dialog--settings .hero-settings-row--greeting {
  margin-bottom: 0;
}
#screen-chat .hero-dialog--settings .hero-settings-range {
  margin-bottom: 10px;
}
#screen-chat .hero-dialog--settings .hero-settings-footer {
  min-height: 40px;
  padding-top: 0;
}
#screen-chat .hero-dialog--settings .hero-settings-save {
  min-height: 40px;
}
@media (max-width: 600px) {
  #screen-chat .hero-dialog--settings .hero-dialog__header { padding: 15px 18px 10px; }
  #screen-chat .hero-dialog--settings .hero-settings-body { padding: 12px 16px 15px; gap: 10px; }
  #screen-chat .hero-dialog--settings .hero-settings-group { padding: 11px 12px 12px; }
  #screen-chat .hero-dialog--settings .hero-settings-footer { flex-wrap: nowrap; }
  #screen-chat .hero-dialog--settings .hero-settings-status { min-width: 0; }
}
/* On exceptionally short windows, prioritize access to every control over clipping. */
@media (max-height: 540px) {
  #screen-chat .hero-dialog--settings { max-height: calc(100dvh - 16px); }
  #screen-chat .hero-dialog--settings .hero-settings-body { overflow-y: auto; }
  #screen-chat .hero-dialog--settings .hero-dialog__header { padding-top: 10px; padding-bottom: 8px; }
}


/* 2026-10-23: reliably centered SVG close icons and compact voice-language order. */
#screen-chat .hero-dialog__close {
  display: grid;
  place-items: center;
  align-content: center;
  justify-items: center;
  line-height: 0;
  padding: 0;
}
#screen-chat .hero-dialog__close svg {
  display: block;
  width: 19px;
  height: 19px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}
#screen-chat .composer {
  grid-template-columns: minmax(0, 1fr) 42px 42px 48px 42px;
  gap: 1px;
}
#screen-chat .composer__language {
  width: 46px;
  height: 34px;
  justify-self: center;
  flex-shrink: 0;
}
#screen-chat .composer__language select {
  display: block;
  width: 100%;
  padding: 0 13px 0 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .02em;
  text-align: center;
  text-align-last: center;
}
#screen-chat .composer__language::after {
  right: 7px;
}
@media (max-width: 600px) {
  #screen-chat .composer {
    grid-template-columns: minmax(0, 1fr) 38px 38px 46px 38px;
    gap: 0;
  }
  #screen-chat .composer__language { width: 44px; height: 32px; }
  #screen-chat .composer__language select { font-size: 10px; padding: 0 13px 0 5px; }
  #screen-chat .composer__icon { width: 38px; }
}
@media (max-width: 390px) {
  #screen-chat .composer {
    grid-template-columns: minmax(0, 1fr) 35px 35px 43px 35px;
    gap: 0;
  }
  #screen-chat .composer__language { width: 41px; height: 30px; }
  #screen-chat .composer__language select { padding: 0 12px 0 4px; font-size: 10px; }
  #screen-chat .composer__icon { width: 35px; }
  #screen-chat .composer__send { width: 34px; height: 34px; }
}


/* 2026-10-23 — Dynamic chat composer. Hidden or removed controls leave NO empty columns.
   Visual order stays: message input | mic | send | language | chat list.
   Supported: Vue v-if / v-show, hidden, display:none, .is-hidden, data-composer-hidden. */
#screen-chat .composer {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: nowrap;
  gap: 1px;
}
#screen-chat .composer > #messageInput {
  flex: 1 1 0%;
  width: 0;
  min-width: 0;
}
#screen-chat .composer > .composer__icon,
#screen-chat .composer > .composer__language {
  flex: 0 0 auto;
  margin: 0;
}
#screen-chat .composer > [hidden],
#screen-chat .composer > .is-hidden,
#screen-chat .composer > [data-composer-hidden="true"] {
  display: none !important;
}
@media (max-width: 600px) {
  #screen-chat .composer { gap: 0; }
}


/* 2026-10-23: Chat transcript audio hook, centered independently of Chat and X. */
#screen-chat .chat-panel__header {
  position: relative;
}
#screen-chat .chat-panel__audio-toggle {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  padding: 0;
  color: var(--gold-strong);
  border-color: rgba(227,168,61,.3);
  background: rgba(227,168,61,.045);
}
#screen-chat .chat-panel__audio-toggle:hover {
  transform: translate(-50%, -50%);
  border-color: var(--line);
  background: rgba(227,168,61,.12);
}
#screen-chat .chat-panel__audio-toggle:active {
  transform: translate(-50%, -50%) scale(.97);
}
#screen-chat .chat-panel__audio-toggle:focus-visible {
  outline: 2px solid var(--gold-strong);
  outline-offset: 2px;
}
#screen-chat .chat-panel__audio-toggle.is-playing {
  color: #ffd991;
  background: rgba(227,168,61,.17);
  box-shadow: inset 0 0 0 1px rgba(227,168,61,.28);
}
#screen-chat .chat-panel__audio-icon {
  display: block;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}
#screen-chat .chat-panel__audio-icon[hidden] {
  display: none !important;
}

/* Search / Account Settings X: always draw two centered CSS strokes.
   Works with the standalone SVG and a Vue template using a text ×.
   Font metrics and inherited SVG rules cannot hide or displace the mark. */
#screen-chat #chatSearchClose,
#screen-chat #settingsCloseBtn {
  position: relative;
  display: grid;
  place-items: center;
  box-sizing: border-box;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  padding: 0;
  font-size: 0; /* Hide text × when a Vue template still uses it. */
  line-height: 0;
  color: #f7e5b7;
  isolation: isolate;
}
/* Ignore any old inline SVG or glyph; one CSS-drawn X is always visible. */
#screen-chat #chatSearchClose > svg,
#screen-chat #settingsCloseBtn > svg {
  display: none !important;
}
#screen-chat #chatSearchClose::before,
#screen-chat #chatSearchClose::after,
#screen-chat #settingsCloseBtn::before,
#screen-chat #settingsCloseBtn::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  display: block;
  width: 18px;
  height: 2.5px;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 999px;
  background: currentColor;
  opacity: 1;
  z-index: 1;
  pointer-events: none;
  transform-origin: center;
}
#screen-chat #chatSearchClose::before,
#screen-chat #settingsCloseBtn::before {
  transform: translate(-50%, -50%) rotate(45deg);
}
#screen-chat #chatSearchClose::after,
#screen-chat #settingsCloseBtn::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}
