.crew-avatar{position:relative;width:145px;height:145px;display:inline-block;flex:none;isolation:isolate}
.crew-avatar-base,.crew-avatar-layer{position:absolute;inset:0;display:block;background-repeat:no-repeat;background-size:300% 300%;background-position:var(--cx,0%) var(--cy,0%);pointer-events:none}
.crew-avatar-base{background-image:url('assets/crew-faces-v17.png');filter:hue-rotate(var(--hue,0deg))}
.crew-avatar-layer{background-image:url('assets/crew-accessories-v17.png')}
.layer-ears{z-index:-1}
.layer-hat{z-index:2}
.layer-glasses{z-index:3}
.team-roster .crew-avatar{width:min(100%,175px);height:auto;aspect-ratio:1}
.crew-slots .crew-avatar{width:100%;height:auto;aspect-ratio:1;display:block}
.network-profile header>.character-icon,.network-profile header>.crew-avatar{width:91px;height:91px;flex:none}
.network-profile header>.character-icon,.network-profile header>.crew-avatar{width:81px;height:81px}
.network-profile header>.character-icon,.network-profile header>.crew-avatar{width:74px;height:74px}
/* Normalize generated atlas cells to a shared face and eye position. */
.crew-avatar-base{inset:auto;width:var(--base-size,80.4%);height:var(--base-size,80.4%);inset-inline-start:var(--base-x,9%);top:var(--base-y,0%);z-index:1}
.crew-avatar-layer{inset:auto}
.layer-ears{z-index:0}
.layer-hat[data-variant="0"]{width:71.8438%;height:71.8438%;inset-inline-start:10.9844%;top:-12.1094%;}
.layer-hat[data-variant="1"]{width:76.7422%;height:76.7422%;inset-inline-start:10.0684%;top:-9.1797%;}
.layer-hat[data-variant="2"]{width:76.7422%;height:76.7422%;inset-inline-start:12.3633%;top:-12.3828%;}
.layer-glasses[data-variant="0"]{width:62.5103%;height:62.5103%;inset-inline-start:16.5391%;top:20.4238%;}
.layer-glasses[data-variant="1"]{width:65.3125%;height:65.3125%;inset-inline-start:17.2656%;top:17.8125%;}
.layer-glasses[data-variant="2"]{width:58.2914%;height:58.2914%;inset-inline-start:20.9238%;top:22.9902%;}
.layer-ears[data-variant="0"]{width:96.3359%;height:96.3359%;inset-inline-start:-1.5674%;top:4.7461%;}
.layer-ears[data-variant="1"]{width:101.2344%;height:101.2344%;inset-inline-start:-0.7383%;top:2.2266%;}
.layer-ears[data-variant="2"]{width:104.5000%;height:104.5000%;inset-inline-start:-2.0625%;top:1.4219%;}
.search-suggestions .directory-portrait,.search-suggestions .crew-avatar{width:49px;height:49px}
.network-profile>header>.directory-portrait,.network-profile>header>.crew-avatar{width:86px;height:86px}
#profile-dialog-body>header>.crew-avatar{width:100px;height:100px}
.team-roster .crew-avatar{width:110px;height:110px;max-width:100%}
.team-roster .crew-avatar{width:80px;height:80px}
.team-roster .crew-avatar{width:65px;height:65px}
.crew-live>.crew-avatar{width:100%;height:100%}
.crew-live .crew-avatar-base{isolation:isolate}
.agent-stage>.crew-avatar{position:relative;display:block;width:100%;height:100%;overflow:visible}
.agent-stage .crew-avatar-base{background-image:url('assets/crew-faces-v17.png');filter:hue-rotate(var(--hue,0deg));transform:none!important}
.agent-stage .crew-avatar-layer{background-image:url('assets/crew-accessories-v17.png');transform:none!important;filter:none!important}
.agent-stage .crew-avatar-layer[hidden]{display:none!important}
.crew-avatar .layer-hair[data-variant="0"]{width:76.7422%;height:76.7422%;inset-inline-start:10.0684%;top:-9.1797%;z-index:2}
/* The original complete head atlas remains a single face. Color changes target its shell, trim and glow separately. */
.agent-stage .crew-avatar-base.has-tinted-face{background-image:none!important}
.agent-stage .crew-tinted-face{display:block;width:100%;height:100%;pointer-events:none}
.agent-stage .crew-extra-eyes{position:absolute;z-index:2;inset-inline-start:27%;top:39%;width:46%;height:29%;background-image:url('assets/agent-eyes-v48.png');background-size:500% 200%;background-position:var(--cx) var(--cy);background-repeat:no-repeat;pointer-events:none}
.agent-stage .crew-extra-eyes[hidden]{display:none!important}
.agent-stage .crew-avatar-layer{filter:var(--accessory-filter,none)!important}
/* Additional accessory cells use the same anchor positions as the calibrated team accessories. */
.crew-avatar .layer-hair[data-expanded=true],.crew-avatar .layer-hat[data-expanded=true],.crew-avatar .layer-glasses[data-expanded=true]{background-size:500% 200%}
.crew-avatar .layer-hair[data-expanded=true]{background-image:url('assets/agent-hair-v48.png');width:76.7422%;height:76.7422%;inset-inline-start:10.0684%;top:-9.1797%;z-index:2}
.crew-avatar .layer-hat[data-expanded=true]{background-image:url('assets/agent-headwear-v48.png');width:76.7422%;height:76.7422%;inset-inline-start:10.0684%;top:-11.1797%;z-index:3}
.crew-avatar .layer-hat[data-expanded=true]{background-size:100% 100%}
.crew-avatar .layer-glasses[data-expanded=true]{background-image:url('assets/agent-glasses-v48.png');width:65.3125%;height:65.3125%;inset-inline-start:17.2656%;top:17.8125%;z-index:4}
.crew-avatar .layer-ears[data-variant="3"]{width:86.3359%;height:86.3359%;inset-inline-start:3.4326%;top:9.7461%}
.crew-avatar .layer-ears[data-variant="4"]{width:105.2344%;height:105.2344%;inset-inline-start:-2.7383%;top:-1.7734%}
.crew-avatar .layer-hat[data-variant="5"]{inset-inline-start:11.6289%;top:-10.5%}
.crew-avatar .layer-hat[data-variant="3"]{top:-17%}
.crew-avatar .layer-hat[data-variant="3"]{inset-inline-start:12%}
.crew-avatar .crew-avatar-layer[data-custom="true"]{background-size:100% 100%;background-position:center}
.crew-avatar .layer-hat[data-custom="true"]{width:80%;height:80%;inset-inline-start:10%;top:-24%;z-index:3}
.crew-avatar .layer-hat[data-variant="9"]{width:84%;height:84%;inset-inline-start:8%;top:-25%}
.crew-avatar .layer-hair[data-custom="true"]{width:92%;height:92%;inset-inline-start:4%;top:8%;z-index:0}
.crew-avatar .layer-hair[data-variant="7"]{width:82%;height:82%;inset-inline-start:9%;top:0%}
.crew-expression{position:absolute;inset:0;width:100%;height:100%;z-index:2;pointer-events:none;overflow:visible;fill:none;stroke:currentColor;stroke-width:7;stroke-linecap:round;stroke-linejoin:round;filter:drop-shadow(0 0 2px currentColor)}
/* Hair behind the silhouette plus a fitted crown in front of the shell. */
.crew-avatar .layer-hair.crew-hair-front[data-custom="true"]{z-index:2;mask-image:linear-gradient(#000 0 28%,transparent 33%);-webkit-mask-image:linear-gradient(#000 0 28%,transparent 33%)}
.crew-avatar .layer-hair.crew-hair-front[data-variant="7"]{mask-image:linear-gradient(#000 0 45%,transparent 50%);-webkit-mask-image:linear-gradient(#000 0 45%,transparent 50%)}
/* Lift the swept Waves fringe away from the eye line on every head. */
.crew-avatar .layer-hair[data-expanded="true"][data-variant="3"]{top:-18%;height:70%;width:76.7422%}
.crew-avatar .layer-hair[data-custom="true"][data-variant="6"],.crew-avatar .layer-hair[data-custom="true"][data-variant="8"]{width:88%;height:82%;inset-inline-start:6%;top:15%}
.crew-avatar .layer-hair[data-custom="true"][data-variant="9"]{width:70%;height:64%;inset-inline-start:15%;top:8%}
.crew-avatar .layer-hair[data-custom="true"][data-variant="10"]{width:32%;height:50%;inset-inline-start:34%;top:-2%}
.crew-avatar .layer-glasses[data-custom="true"]{width:65%;height:65%;inset-inline-start:17.5%;top:21%;z-index:4}
.crew-avatar .layer-hair.crew-hair-front[data-variant="9"],.crew-avatar .layer-hair.crew-hair-front[data-variant="10"]{mask-image:none;-webkit-mask-image:none}
.crew-avatar .layer-hat[data-custom="true"][data-variant="10"]{width:64%;height:38%;inset-inline-start:18%;top:-4%}
.crew-expression{filter:none;stroke-width:12}
.crew-expression .screen-bloom{stroke:currentColor;stroke-width:20;filter:blur(6px);opacity:.85}
.crew-expression .screen-rim{stroke:currentColor;stroke-width:13;filter:drop-shadow(0 0 4px currentColor)}
.crew-expression .screen-core{stroke:#fff5ff;stroke-width:6;filter:drop-shadow(0 0 1px #fff)}
.crew-avatar .layer-glasses[data-custom="true"][data-variant="5"]{width:72%;height:25%;inset-inline-start:14%;top:42%}
.crew-avatar .layer-glasses[data-custom="true"][data-variant="6"]{width:62%;height:24%;inset-inline-start:19%;top:42.5%}
/* Keep the repaired officer artwork on the original calibrated anchor. */
.crew-avatar .layer-hat[data-custom="true"][data-variant="3"]{width:76.7422%;height:76.7422%;inset-inline-start:12%;top:-17%}
/* Rebuilt short hair uses one crisp foreground sprite, with clear eye space. */
.crew-avatar .layer-hair[data-custom="true"]:is([data-variant="2"],[data-variant="3"],[data-variant="4"],[data-variant="5"]){width:76%;height:76%;inset-inline-start:12%;top:-12%;z-index:2}
/* Seat the two new crowns against the shell while keeping the eyes clear. */
.crew-avatar .layer-hair[data-custom="true"]:is([data-variant="3"],[data-variant="5"]){top:-6%}
/* Full hair cutouts leave an open face and carry their own side tails. */
.crew-avatar .layer-hair[data-custom="true"][data-variant="11"]{width:96%;height:84%;inset-inline-start:2%;top:18%;z-index:2}
.agent-stage{position:relative;width:100%;height:100%}.agent-stage>.crew-avatar{position:absolute;inset:0;width:100%;height:100%;display:block;isolation:isolate}.crew-avatar [hidden]{display:none!important}

/* Stable option 11: artwork uses the complete 512px portrait frame. */
.crew-avatar .layer-hat[data-custom="true"][data-variant="11"]{width:100%;height:100%;inset-inline-start:0;top:0;z-index:3}

/* A Bot appears only once every layer and its framing are ready. */
.portrait-loading-name{position:absolute;inset:0;display:grid;place-items:center;padding:10%;box-sizing:border-box;border-radius:inherit;background:var(--soft,#f2ecfa);color:var(--purple-dark,#541c91);font:600 12px/1.2 sans-serif;text-align:center;overflow:hidden;overflow-wrap:anywhere}
