/* Each atlas cell is a knee-length 2:3 cutout. Size from the real dialogue height. */
.portrait{
 width:min(39vw,calc((100dvh - var(--dialogue-panel-height,220px) - 85px)*.66667));
 height:auto;aspect-ratio:2/3;
 bottom:calc(var(--dialogue-panel-height,220px) + 4.5% + 5px);
 background-image:url('/assets/characters/portraits-seven.png');background-size:300% 200%;
 mask-image:linear-gradient(to bottom,transparent,black 1.5%,black 97%,transparent);
}
.portrait.female{background-image:url('/assets/characters/wife-seven.png');background-size:300% 100%}
/* These two Wang atlas cells contain a neighbouring robe in their empty left gutter.
   The crop stops before Wang's own sleeve; it does not change the source artwork. */
.portrait:not(.prologue-portrait):not(.female)[style*="50% 0%"]{clip-path:inset(0 0 0 9%)}
.portrait:not(.prologue-portrait):not(.female)[style*="100% 0%"]{clip-path:inset(0 0 0 4.5%)}
.portrait.gaze-away{background-image:url('/assets/characters/portraits-seven-away.png')}
.portrait.female.gaze-away{background-image:url('/assets/characters/wife-seven-away.png')}
@media(max-width:700px) and (orientation:portrait){
 .portrait{width:min(84vw,calc((100dvh - var(--dialogue-panel-height,240px) - 85px)*.66667));bottom:calc(var(--dialogue-panel-height,240px) + 4% + 5px)}
 .portrait-left.speaking,.portrait-right.speaking{left:50%;right:auto;transform:translateX(-50%);animation:none}
}
@media(max-height:600px) and (orientation:landscape){
 .portrait{width:calc((100dvh - var(--dialogue-panel-height,140px) - 65px)*.66667);bottom:calc(var(--dialogue-panel-height,140px) + 5% + 4px)}
}
