/* Profile artwork has its own centered frame instead of inheriting list offsets. */
body[data-studio-page] #caProfileArt{display:flex!important;justify-content:center!important;align-items:center!important;padding:0!important;margin-left:0!important;margin-right:0!important;overflow:hidden!important;width:100%!important}
body[data-studio-page] #caProfileArt .ca-art{position:relative!important;display:flex!important;align-items:center!important;justify-content:center!important;margin:0 auto!important;transform:none!important;left:auto!important;right:auto!important}
body[data-studio-page] #caProfileArt img{position:static!important;inset:auto!important;display:block!important;width:100%!important;height:100%!important;max-width:100%!important;object-fit:contain!important;object-position:center!important;margin:0 auto!important;padding:0!important;transform:none!important}
body :is(#caChainText,#efCharacterRecordPager) .studio-chain-brief ul{display:grid;gap:8px;list-style:none;padding:0;margin:10px 0}
body :is(#caChainText,#efCharacterRecordPager) .studio-chain-brief li{padding:9px 10px;border:1px solid #c4ac7466;color:#f1dfb8;font:400 14px/1.6 var(--studio-font,serif);letter-spacing:0;overflow-wrap:anywhere}
body :is(#caChainText,#efCharacterRecordPager) .studio-chain-brief details{font:400 11px/1.7 var(--studio-font,serif);margin-top:12px}
body :is(#caChainText,#efCharacterRecordPager) .studio-chain-brief summary{cursor:pointer;color:#bfd0da}
body :is(#caChainText,#efCharacterRecordPager) .studio-chain-brief p{white-space:pre-line}

/* Independent lower constellation controls. Original full text stays above. */
body #chainProgress{max-height:42dvh;overflow:auto!important;overscroll-behavior:contain}
body #chainProgress .studio-lower-chain-tabs{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:4px;margin:6px 0}
body #chainProgress .studio-lower-chain-tabs button{min-width:0;padding:7px 1px;border:1px solid #afc5cf66;background:#102b3b;color:#bed0da;font:400 11px/1.4 var(--studio-font,serif);cursor:pointer}
body #chainProgress .studio-lower-chain-tabs button[aria-pressed=true]{background:#405866;color:#f4dfb2;border-color:#d9bd83}
body #chainProgress .studio-lower-chain-values small{font-size:10px;color:#a9c0cc}
body #chainProgress .studio-lower-chain-values ul{list-style:none;display:grid;gap:5px;padding:0;margin:6px 0}
body #chainProgress .studio-lower-chain-values li{font:400 12px/1.55 var(--studio-font,serif);color:#f0dfb9;padding:5px 7px;border:1px solid #bda47444;overflow-wrap:anywhere}

/* Endfield: update only the existing lower summary, leaving its artwork and full text intact. */
body[data-studio-page=endfield] .studio-endfield-lower{font-family:var(--studio-font,serif);letter-spacing:0}
body[data-studio-page=endfield] .studio-endfield-lower h4{font-size:13px;font-weight:400;margin:0 0 7px;color:#e8d7b0}
body[data-studio-page=endfield] .studio-endfield-lower-tabs{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:4px;margin:7px 0}
body[data-studio-page=endfield] .studio-endfield-lower button{font:400 11px/1.4 var(--studio-font,serif);padding:7px 2px;color:#bed0da;background:#102b3b;border:1px solid #afc5cf66;cursor:pointer}
body[data-studio-page=endfield] .studio-endfield-lower button[aria-pressed=true]{color:#f4dfb2;background:#405866;border-color:#d9bd83}
body[data-studio-page=endfield] .studio-endfield-lower small{font-size:10px;color:#acc2cd}
body[data-studio-page=endfield] .studio-endfield-lower ul{list-style:none;display:grid;gap:6px;padding:0;margin:7px 0}
body[data-studio-page=endfield] .studio-endfield-lower li{font-size:12px;line-height:1.6;color:#efdeb7;overflow-wrap:anywhere}

/* Keep the full-text area readable when the lower summary contains many effects. */
body[data-studio-page=genshin] #chainProgress{flex:0 1 50%!important;max-height:30dvh}

/* Wuwa: preserve room for the original effect text above dense numeric summaries. */
body[data-studio-page=wutheringwave] #chainProgress{flex:0 1 50%!important;max-height:30dvh}

/* Narrow Wuwa profiles: keep full names readable without competing with the menu space. */
@media(max-width:360px){
 body[data-studio-page=wutheringwave] #caProfile .ca-profile-head{display:grid!important;grid-template-columns:minmax(0,1fr)!important;gap:4px!important}
 body[data-studio-page=wutheringwave] #caProfile .ca-profile-head small{display:none!important}
 body[data-studio-page=wutheringwave] #caProfile .ca-profile-head .ca-btn{justify-self:start;padding:6px 8px!important;margin:0}
}

/* Endfield: reviewed conditions open outside the fixed-height gallery cards. */
body[data-studio-page=endfield] .studio-endfield-notes-dialog{box-sizing:border-box;margin:auto;inset:0;max-width:calc(100vw - 24px);width:min(640px,calc(100vw - 24px));max-height:calc(100dvh - 24px);padding:16px;color:#d6e3ec;background:#102b3b;border:1px solid #afc5cf88;font-family:var(--studio-font,serif);overflow:auto}
body[data-studio-page=endfield] .studio-endfield-notes-dialog::backdrop{background:#04121dcc}
body[data-studio-page=endfield] .studio-endfield-notes-dialog form{display:flex;justify-content:flex-end;margin:0 0 8px}
body[data-studio-page=endfield] .studio-endfield-notes-dialog button{font:inherit;font-size:12px;padding:7px 14px;color:#f4dfb2;background:#203d4e;border:1px solid #d9bd83;cursor:pointer}
body[data-studio-page=endfield] .studio-endfield-notes-dialog h3{margin:0 0 12px;font-size:17px;font-weight:400;color:#f4dfb2}
body[data-studio-page=endfield] .studio-endfield-notes-dialog p{font-size:13px;line-height:1.8;overflow-wrap:anywhere;margin:0 0 13px}
body[data-studio-page=endfield] .studio-endfield-lower-heading{display:flex;align-items:center;justify-content:space-between;gap:6px;flex-wrap:wrap}
body[data-studio-page=endfield] .studio-endfield-lower-heading h4{margin:0}
body[data-studio-page=endfield] .studio-endfield-lower .studio-endfield-notes-open{font-size:10px;padding:4px 7px;white-space:nowrap}

/* Endfield potential cards keep their art height; the gallery scrolls on short screens. */
body[data-studio-page="endfield"] #dupeView.active .dupe-list{
 grid-template-rows:none!important;grid-auto-rows:max-content!important;
 align-content:start;overflow-y:auto!important;overflow-x:hidden!important;
 overscroll-behavior:contain;scrollbar-width:thin;
}
body[data-studio-page="endfield"] #dupeView.active .dupe-card{
 height:auto!important;overflow:visible!important;flex-direction:column;align-items:stretch;
}
body[data-studio-page="endfield"] #dupeView.active .dupe-card>img{
 flex:none!important;height:auto!important;min-height:0!important;max-height:none!important;
 object-fit:contain!important;
}
body[data-studio-page="endfield"] #dupeView.active .dupe-card>.studio-potential-summary{
 flex:none;max-height:none!important;overflow:visible!important;
}

/* Hu Tao: center the character body, excluding the ghost and surrounding flame ring. */
body[data-studio-page="genshin"] #caProfileArt .ca-art img[alt="胡桃"]{
 transform:translateX(-4%)!important;
}

/* Zhongli: align the face and torso, keeping the full-size artwork. */
body[data-studio-page="genshin"] #caProfileArt .ca-art img[alt="鍾離"]{transform:translateX(3%)!important;}

/* Slightly enlarge Genshin individual-profile artwork, reserving vertical space. */
body[data-studio-page=genshin] #caProfileArt{max-height:calc(44.08dvh + 48px)!important}
body[data-studio-page=genshin] #caProfileArt .ca-art{scale:1.16;margin-top:24px!important;margin-bottom:24px!important}

/* Wuwa: slightly larger art only after character selection; keep native focal positioning. */
body[data-studio-page=wutheringwave] #caProfileArt{--studio-profile-art-limit:44.08dvh;max-height:var(--studio-profile-art-limit)!important}
body[data-studio-page=wutheringwave] #caProfileArt img{max-height:var(--studio-profile-art-limit)!important}
@media(max-width:700px){body[data-studio-page=wutheringwave] #caProfileArt{--studio-profile-art-limit:32.48dvh}}
@media(max-height:600px){body[data-studio-page=wutheringwave] #caProfileArt{--studio-profile-art-limit:16.24dvh}}

/* Endfield: give selected-character potential images more width without cropping. */
body[data-studio-page=endfield] .char-drawer:has(#dupeView.active) .char-stage{padding-left:4px!important;padding-right:4px!important}
body[data-studio-page=endfield] #dupeView.active .dupe-list{max-width:912px!important}

/* Wuwa short profiles: use available artwork space while keeping both controls visible. */
@media(max-height:600px){body[data-studio-page=wutheringwave] #caProfileArt{--studio-profile-art-limit:24dvh}}
