.panda-editor-dialog{position:fixed;inset:0;margin:0;padding:0;border:0;width:100vw;height:100dvh;max-width:none;max-height:none;background:#fffcf7;color:#4d3b48;overflow:auto;overscroll-behavior:contain}
.panda-editor-dialog::backdrop{background:#fffcf7}
.panda-editor{max-width:1210px;padding:30px 38px 36px;margin:auto;box-sizing:border-box;min-height:100%}
.panda-editor *{box-sizing:border-box}
.panda-editor button{font:inherit;cursor:pointer;-webkit-tap-highlight-color:transparent}
.panda-editor button:disabled{cursor:default;opacity:.4}
.panda-editor button:focus-visible,.panda-editor input:focus-visible{outline:3px solid #a66bc2;outline-offset:4px}
.panda-editor__heading{display:flex;align-items:center;gap:14px;margin-bottom:25px}
.panda-editor__heading h1{font-size:25px;line-height:1.35;margin:0;font-weight:800}
.panda-editor__brand{margin-left:auto;font-size:12px;letter-spacing:3px;font-weight:800;color:#b58b40}
.panda-editor__back{display:grid;place-items:center;border:0;background:transparent;color:#9d8e9c;padding:8px;border-radius:14px;width:46px;height:46px}
.panda-editor__back:hover{background:#f2e9f5;color:#8b3bb0}
.panda-editor svg{display:block}
.panda-editor__back svg,.panda-editor__preview-toolbar svg,.panda-editor__preview-actions svg{width:23px;height:23px}
.panda-editor__workspace{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.08fr);background:white;border:2px solid #e9e1e9;border-radius:30px;overflow:hidden;min-height:576px}
.panda-editor__preview{position:relative;isolation:isolate;display:flex;flex-direction:column;padding:22px 27px 20px;background:radial-gradient(ellipse at 34% 24%,#fffaf0 0%,#f5eafa 64%,#eadcf0 100%);border-right:2px solid #e9e1e9;overflow:hidden}
.panda-editor__preview:before{content:'';position:absolute;inset:auto auto -50px -40px;width:230px;height:230px;border-radius:50%;border:30px solid #fff5c975;z-index:-1}
.panda-editor__preview-toolbar{display:flex;justify-content:space-between;align-items:center;color:#9b7ba4;font-size:13px;font-weight:700;z-index:1}
.panda-editor__preview-toolbar>div{display:flex;gap:4px}
.panda-editor__preview-toolbar button{display:grid;place-items:center;width:35px;height:34px;padding:6px;border:0;border-radius:10px;background:#ffffffb8;color:#8a628e}
.panda-editor__stage{display:grid;place-items:center;flex:1;min-height:370px;padding:2px 16px 7px}
.panda-editor__stage>.panda-avatar{width:min(100%,330px);height:auto;max-height:400px;filter:drop-shadow(0 15px 12px #6e446b13)}
.panda-editor__stage>.panda-wardrobe{width:min(100%,360px);aspect-ratio:1;max-height:420px;filter:none}
.panda-editor__portrait{position:absolute;right:21px;bottom:86px;display:flex;flex-direction:column;align-items:center;gap:4px;font-size:11px;color:#9c7da2}
.panda-editor__portrait>span{display:block;width:68px;height:68px;border:4px solid white;border-radius:50%;overflow:hidden;box-shadow:0 3px 9px #8b61921c;background:white}
.panda-editor__portrait svg{width:100%;height:100%}
.panda-editor__preview-actions{display:flex;justify-content:center;gap:13px;padding-top:12px;z-index:1}
.panda-editor__preview-actions button{display:flex;align-items:center;gap:7px;border:1px solid #decede;border-bottom-width:3px;border-radius:13px;padding:10px 15px;background:#fffdfbe8;color:#815387;font-size:13px;font-weight:700}
.panda-editor__preview-actions button:active{transform:translateY(2px);border-bottom-width:1px}
.panda-editor__controls{display:flex;flex-direction:column;min-width:0;height:576px}
.panda-editor__presets{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:7px;padding:14px 18px 0}
.panda-editor__presets button{height:58px;display:grid;place-items:center;border:1px solid #e8dced;border-radius:12px;background:#fffaf4;overflow:hidden;padding:2px}
.panda-editor__presets button:hover{border-color:#be8fd1;background:#faf0ff}
.panda-editor__presets svg{width:54px;height:54px;max-width:100%}
.panda-editor__tabs{display:flex;align-items:stretch;padding:12px 12px 0;gap:1px;border-bottom:2px solid #f1eaf1;overflow-x:auto;scrollbar-width:none;flex-shrink:0}
.panda-editor__tabs::-webkit-scrollbar{display:none}
.panda-editor__tabs button{flex:1;min-width:44px;display:flex;align-items:center;flex-direction:column;gap:6px;padding:6px 1px 12px;border:0;border-bottom:3px solid transparent;background:transparent;color:#b2a7b2;white-space:nowrap;font-size:10px;font-weight:700;transition:color .15s}
.panda-editor__tabs button{min-height:70px;gap:8px;font-size:13px}
.panda-editor__tabs svg{width:27px;height:27px}
.panda-editor__tabs button[aria-selected="true"]{color:#943fb4;border-color:#ab58cd}
.panda-editor__tabs button:hover{color:#9250a9}
.panda-editor__options{overflow-y:auto;scrollbar-width:thin;scrollbar-color:#e3d3e9 transparent;padding:24px 25px 30px;flex:1}
.panda-editor__field+section{margin-top:26px}
.panda-editor__field h2{font-size:18px;margin:0 0 16px;font-weight:800;color:#645363}
.panda-editor__choices{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.panda-editor__choice{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;border:2px solid #ebe4ec;border-bottom-width:4px;border-radius:16px;padding:7px 4px 8px;background:#fff;color:#958496;position:relative;min-width:0;transition:border-color .12s,background .12s}
.panda-editor__choice:hover{border-color:#d6bbdf;background:#fffaff}
.panda-editor__choice.is-selected{border-color:#bd84d5;background:#f7edfc;color:#8840aa;box-shadow:0 0 0 2px #eeddF5}
.panda-editor__choice>span:last-child{font-size:11px;font-weight:650;line-height:1.35}
.panda-editor__thumbnail{display:block;width:76px;height:76px;max-width:100%}
.panda-editor__thumbnail svg{width:100%;height:100%}
.panda-editor__choices.is-colors{grid-template-columns:repeat(4,minmax(0,1fr));gap:13px}
.is-colors .panda-editor__choice{padding:8px 5px 9px;gap:8px}
.panda-editor__swatch{width:48px;height:48px;max-width:100%;border-radius:12px;display:block;background:var(--panda-swatch);box-shadow:inset 0 1px 1px #ffffff60,inset 0 -3px 3px #00000008}
.panda-editor__swatch.is-auto{background:linear-gradient(135deg,#ffd56c 0 33%,var(--panda-swatch) 34% 66%,#badee9 67%)}
.panda-editor__footer{display:flex;justify-content:space-between;align-items:center;gap:20px;padding:25px 0 0}
.panda-editor__companion{display:flex;align-items:center;gap:9px;font-size:14px;color:#927d94;cursor:pointer}
.panda-editor__companion input{appearance:auto;accent-color:#9841b8;width:18px;height:18px;margin:0}
.panda-editor__finish{display:flex;align-items:center;gap:18px;margin-left:auto}
@media(max-width:620px){.panda-editor__stage>.panda-avatar.panda-wardrobe{height:178px;max-height:100%}}
.panda-editor__finish>.button{min-width:154px;font-size:16px;padding:13px 30px;flex-shrink:0}
.panda-editor__error{color:#b34d65;font-size:13px;margin:0;max-width:230px}
.panda-editor__discard{position:fixed;inset:0;z-index:3;display:grid;place-items:center;background:#45354838;padding:25px}
.panda-editor__discard section{max-width:380px;padding:30px;background:#fffaf5;border:2px solid #e8d8eb;border-radius:25px;box-shadow:0 20px 70px #46354620;width:100%}
.panda-editor__discard h2{font-size:21px;margin:0 0 25px}
.panda-editor__discard button{width:100%;margin-top:10px}
.custom-panda-avatar{display:block;overflow:hidden;background:#fff8ef;border-radius:50%;width:var(--avatar-size);height:var(--avatar-size);flex-shrink:0}
.custom-panda-avatar .panda-avatar{width:100%;height:100%;max-width:none}
.custom-design-companion{display:block;width:var(--panda-character-size,144px);max-width:100%;height:auto}
.custom-design-companion .panda-avatar{width:100%;height:auto}
.panda-create-card{display:flex;align-items:center;justify-content:space-between;gap:20px;background:linear-gradient(125deg,#fff7d9,#f7e8fc);border:1px solid #ecdced;border-radius:24px;padding:20px 25px;margin:22px 0}
.panda-create-card__preview{width:95px;height:105px;flex-shrink:0;display:grid;place-items:center}
.panda-create-card__preview svg{height:100%;width:100%}
.panda-create-card h2{font-size:21px;margin:0 0 8px}.panda-create-card p{font-size:13px;margin:0 0 14px;color:#988095}
@media(max-width:850px){.panda-editor{padding:22px}.panda-editor__workspace{grid-template-columns:minmax(0,.85fr) minmax(0,1fr)}.panda-editor__options{padding:22px 18px}.panda-editor__tabs{padding:10px 8px 0}.panda-editor__tabs button{min-width:42px}.panda-editor__choices.is-colors{grid-template-columns:repeat(3,minmax(0,1fr))}.panda-editor__portrait{right:13px}.panda-editor__preview{padding:18px}.panda-editor__brand{display:none}}
@media(max-width:620px){.panda-editor{padding:14px 13px 104px}.panda-editor__heading{gap:7px;margin-bottom:13px}.panda-editor__heading h1{font-size:20px}.panda-editor__back{width:36px;height:36px}.panda-editor__workspace{grid-template-columns:1fr;border-radius:23px}.panda-editor__preview{position:sticky;top:0;height:268px;min-height:268px;max-height:268px;padding:10px 17px 12px;border-right:0;border-bottom:2px solid #e9e1e9}.panda-editor__preview-toolbar{font-size:11px}.panda-editor__preview-toolbar button{width:28px;height:26px;padding:4px}.panda-editor__preview-toolbar svg{width:18px;height:18px}.panda-editor__stage{min-height:0;padding:0;height:184px}.panda-editor__stage>.panda-avatar{height:191px;width:auto;max-height:none}.panda-editor__portrait{bottom:44px;right:15px;gap:2px}.panda-editor__portrait>span{width:49px;height:49px;border-width:3px}.panda-editor__portrait small{font-size:9px}.panda-editor__preview-actions{padding:0;gap:16px}.panda-editor__preview-actions button{padding:5px 12px;border-radius:10px;font-size:11px;border-bottom-width:2px}.panda-editor__preview-actions svg{width:16px;height:16px}.panda-editor__controls{height:420px}.panda-editor__tabs{padding:8px 7px 0;gap:3px}.panda-editor__tabs button{min-width:42px;padding-bottom:9px;font-size:9px}.panda-editor__tabs svg{width:22px;height:22px}.panda-editor__options{padding:20px 18px 28px}.panda-editor__field h2{font-size:16px;margin-bottom:13px}.panda-editor__choices{gap:10px}.panda-editor__thumbnail{width:67px;height:67px}.panda-editor__choices.is-colors{grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}.panda-editor__swatch{width:43px;height:43px}.panda-editor__choice>span:last-child{font-size:10px}.panda-editor__footer{position:fixed;bottom:0;left:0;right:0;padding:13px 16px max(13px,env(safe-area-inset-bottom));background:#fffcf7f5;border-top:1px solid #e9dfe9;z-index:2;gap:8px;backdrop-filter:blur(12px)}.panda-editor__companion{font-size:11px;gap:5px;max-width:174px;line-height:1.45}.panda-editor__companion input{width:16px;height:16px}.panda-editor__finish{flex-direction:column-reverse;gap:3px;align-items:flex-end}.panda-editor__finish>.button{min-width:110px;font-size:14px;padding:11px 21px}.panda-editor__error{font-size:10px;max-width:145px}.panda-create-card{padding:18px;gap:12px}.panda-create-card h2{font-size:18px}.panda-create-card__preview{width:75px;height:92px}}
@media(prefers-reduced-motion:reduce){.panda-editor *{transition:none!important;scroll-behavior:auto!important}}

/* Keep preset avatar spans and the editing canvas independent. */
.profile-intro>div{min-width:0}.profile-id{overflow-wrap:anywhere}
body:has(#panda-editor-dialog[open]){overflow:hidden}
.panda-editor__workspace{height:clamp(420px,calc(100dvh - 210px),660px);min-height:0}
.panda-editor__controls{height:100%;min-height:0}
.panda-editor__stage{min-height:0}
.panda-editor__stage>.panda-avatar{max-height:min(400px,calc(100dvh - 340px))}
.panda-editor__preview-toolbar button{min-width:0;min-height:0}
@media(max-width:620px){.panda-editor__workspace{height:auto}.panda-editor__preview{height:286px;min-height:286px;max-height:286px}.panda-editor__stage>.panda-avatar{height:196px;max-height:none}.panda-editor__preview-actions button{min-height:30px}.panda-editor__controls{height:calc(100dvh - 414px);min-height:270px;max-height:420px}}

/* Five purposeful controls: shape, color, headwear, outfit/prop and background. */
.panda-editor__presets{padding:14px 20px 0;gap:8px}
.panda-editor__presets button{height:62px;border-color:#e8e0e9;background:#fffdfa}
.panda-editor__presets button[aria-pressed="true"]{border-color:#ae66cb;background:#f7ecfc;box-shadow:0 0 0 1px #ae66cb}
.panda-editor__tabs{padding:13px 18px 0;gap:5px}
.panda-editor__tabs button{min-width:74px;min-height:72px;font-size:11px;gap:7px;padding:5px 3px 11px}
.panda-editor__tabs svg{width:25px;height:25px}
.panda-editor__options{padding:23px 24px 28px}
.panda-editor__field+section{margin-top:24px}
.panda-editor__field h2{font-size:16px;margin-bottom:12px;color:#604a65}
.panda-editor__choices{gap:10px}
.panda-editor__choice{padding:9px 5px 10px;min-height:112px;border-radius:15px;background:#fff;box-shadow:none}
.panda-editor__choice>span:last-child{font-size:12px;line-height:1.45}
.panda-editor__choice.is-selected{box-shadow:none;background:#faf2fe}
.panda-editor__choices.is-body .panda-editor__thumbnail{height:94px;width:94px}
.panda-editor__choices.is-colors{grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}
.panda-editor__choices.is-colors .panda-editor__choice{min-height:91px;padding:9px 5px 10px}
.panda-editor__swatch{width:40px;height:40px;border-radius:50%;border:1px solid #6d496814}
.panda-editor__choice.is-selected:after{content:'\2713';position:absolute;right:6px;top:4px;font-size:12px;font-weight:800;color:#9b4bbe}
.panda-editor__preview{background:radial-gradient(ellipse at 44% 26%,#fffdfa 0%,#f7f0f9 66%,#eee4f4 100%)}
.panda-editor__preview:before{display:none}
@media(max-width:850px){.panda-editor__tabs{padding-inline:10px}.panda-editor__tabs button{min-width:69px;font-size:10px}.panda-editor__options{padding-inline:18px}.panda-editor__presets{padding-inline:14px;gap:6px}.panda-editor__choices.is-colors{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:620px){.panda-editor__presets{padding:11px 13px 0;gap:7px}.panda-editor__presets button{height:52px}.panda-editor__tabs{padding:10px 10px 0;gap:4px}.panda-editor__tabs button{min-width:64px;min-height:65px;font-size:10px}.panda-editor__tabs svg{width:23px;height:23px}.panda-editor__controls{min-height:345px}.panda-editor__options{padding:18px 15px 24px}.panda-editor__choice{min-height:103px;padding-block:7px}.panda-editor__choice>span:last-child{font-size:11px}.panda-editor__choices.is-body .panda-editor__thumbnail{height:82px;width:82px}.panda-editor__choices.is-colors{grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}.panda-editor__choices.is-colors .panda-editor__choice{min-height:83px}.panda-editor__swatch{width:34px;height:34px}.panda-editor__field h2{font-size:15px}.panda-editor__portrait{right:11px}.panda-editor__stage>.panda-wardrobe{height:196px;max-height:196px;width:196px}}
