/* Natural frames preserve content and bound its presence; cover is opt-in only. */
.deru-media{--media-max-height:520px;--media-ratio:1.333333;position:relative;display:block;align-self:start;width:min(100%,calc(var(--media-ratio)*var(--media-max-height)));height:auto;min-height:0;max-height:none;aspect-ratio:var(--media-ratio);padding:0;background:transparent;overflow:hidden}
.deru-media>.deru-media-image{display:block;position:static;inset:auto;width:100%;height:auto;max-width:100%;max-height:none;object-fit:contain;background:transparent}
.deru-media[data-fit=cover]>.deru-media-image{height:100%;object-fit:cover}
/* Specificity bridges incumbent surfaces without copying the media implementation. */
.living-system :is(.work-editorial-art,.ls-preview).deru-media{width:min(100%,calc(var(--media-ratio)*var(--media-max-height)));height:auto;min-height:0;max-height:none;aspect-ratio:var(--media-ratio);padding:0;background:transparent;border-radius:var(--radius-sm)}
.living-system :is(.work-editorial-art,.ls-preview).deru-media>img{position:static;display:block;width:100%;height:auto;max-width:100%;max-height:none;object-fit:contain;background:transparent}
.deru-media.media-ready>svg{display:none}
.deru-media>span{position:absolute;inset:0;display:grid;place-items:center}
.deru-media>span[hidden]{display:none}
.living-system .library-resource-media{background:transparent}
.living-system .library-resource-media .deru-media{--media-max-height:680px}
.living-system .work-editorial-art.deru-media{--media-max-height:580px;justify-self:start}
.living-system #project-content:not([data-surface=summary]) .work-editorial-art.deru-media{--media-max-height:180px}
.living-system .work-card-cover:has(.deru-media){width:110px;aspect-ratio:auto;overflow:visible;align-self:start}
.living-system .work-card-cover .deru-media{--media-max-height:160px}
.living-system .operator-work-cover{width:auto;height:auto;max-width:min(35%,300px);max-height:300px;object-fit:contain;background:transparent}
.living-system .client-work-art{height:auto;aspect-ratio:auto;background:transparent}
.living-system .client-work-art img{width:100%;height:auto;max-height:160px;object-fit:contain}
@media(max-width:480px){.living-system .operator-work-cover{float:none;max-width:100%;max-height:260px;margin:0 0 20px}}
.living-system .deru-media.media-ready>.deru-media-image{opacity:1}
.living-system.ls-portal .library-portal .library-resource-media .library-thumb.deru-media{min-height:0;padding:0;aspect-ratio:var(--media-ratio);background:transparent}
.living-system.ls-portal .library-portal .library-resource-media .library-thumb.deru-media img{position:static;height:auto;max-height:none}
.living-system.ls-portal :is(.recent-work-item,.library-card-open):hover .deru-media img{transform:none}
.living-system.ls-portal .recent-work-item .work-preview:has(.deru-media),.living-system.ls-portal .portal-work-card .work-card-cover:has(.deru-media){height:auto;max-height:none;aspect-ratio:auto;background:transparent;overflow:visible}
.living-system.ls-portal .work-preview .deru-media{--media-max-height:400px}
.living-system.ls-portal .portal-work-card .deru-media{--media-max-height:320px}
/* Artwork edges belong to the piece: no masking of poster corners. */
.living-system.ls-portal :is(.library-card .library-thumb,.library-resource-media .library-thumb.has-image).deru-media{border-radius:0;overflow:visible}
