/* Explicit photo selections keep their natural selected ratio in every layout. */
.photo-frame{display:block;position:relative;overflow:hidden;max-width:100%;width:min(100%,calc(var(--photo-max-height,2000px)*var(--photo-ratio)));margin-inline:auto;isolation:isolate}
.photo-frame>img,.inv-gallery .ig-photo .photo-frame>img{display:block;position:absolute;max-width:none!important;max-height:none!important;min-height:0!important;aspect-ratio:auto!important;object-fit:fill!important;border-radius:0!important;transform:none!important;margin:0!important}
.cover-photo{width:min(82%,340px);margin:24px auto;--photo-max-height:320px}
.sc-portrait{width:min(70%,240px);margin:14px auto;--photo-max-height:200px}
.sc-portrait .photo-frame,.cover-photo .photo-frame{border-radius:20px;box-shadow:0 8px 26px #0002}
.photo-crop-editor{border-top:1px solid #ddd;padding-top:16px;display:grid;gap:12px}
.photo-crop-editor select{max-width:100%}
.photo-crop-stage{position:relative;overflow:hidden;touch-action:none;user-select:none;width:min(100%,460px);margin:auto;background:#f4f1ea;line-height:0}
.photo-crop-stage>img{display:block;width:100%;height:auto;pointer-events:none}
.photo-crop-selection{position:absolute;border:2px solid white;outline:1px solid #2228;box-shadow:0 0 0 1200px #0009;cursor:move;touch-action:none;background-image:linear-gradient(#fff6,#fff6),linear-gradient(#fff6,#fff6),linear-gradient(#fff6,#fff6),linear-gradient(#fff6,#fff6);background-size:1px 100%,1px 100%,100% 1px,100% 1px;background-position:33.33% 0,66.66% 0,0 33.33%,0 66.66%;background-repeat:no-repeat}
.photo-crop-stage{cursor:crosshair}.photo-crop-handle{position:absolute;width:22px;height:22px;border-radius:50%;border:2px solid white;background:#654d83;box-shadow:0 1px 4px #0006}.photo-crop-nw{left:-3px;top:-3px;cursor:nwse-resize}.photo-crop-ne{right:-3px;top:-3px;cursor:nesw-resize}.photo-crop-sw{left:-3px;bottom:-3px;cursor:nesw-resize}.photo-crop-se{right:-3px;bottom:-3px;cursor:nwse-resize}
.photo-crop-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.photo-crop-fields label{display:grid;gap:4px;font-size:13px}
.photo-crop-fields input{width:100%;border:1px solid #bbb;border-radius:8px;padding:7px}
.photo-crop-preview{width:min(100%,260px);margin:auto;--photo-max-height:240px}
.photo-crop-editor [hidden]{display:none!important}
.inv-gallery .photo-frame{--photo-max-height:480px}
.ig-filmstrip .photo-frame{--photo-max-height:420px}
