.photo-zoom {
    position: fixed;
    inset: clamp(8px, calc(100dvh - 538px), 20px) auto auto clamp(8px, calc(100vw - 813px), 100px);
    z-index: 1000;
    margin: 0;
    padding: 0;
    box-sizing: border-box !important;
    width: 805px;
    height: 530px;
    max-width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
    border: 4px solid #67605a;
    background: #000;
    color: #fff;
    overflow: hidden;
    box-shadow: 0 3px 11px #0008;
}
.photo-zoom[open], .photo-zoom-page { display: flex; flex-direction: column; }
.photo-zoom-page {
    margin: 8px;
    width: min(805px, calc(100vw - 16px));
    height: min(530px, calc(100dvh - 16px));
    background: #000;
    color: #fff;
}
.photo-zoom.is-minimized { height: auto; }
.photo-zoom.is-minimized .photo-zoom-viewport { display: none; }
.photo-zoom-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex: none;
    min-height: 23px;
    padding: 0 4px 0 7px;
    background: linear-gradient(#534f4a, #2f2b27);
    color: #ff9a47;
    font: bold 14px Tahoma, Arial, sans-serif;
    user-select: none;
}
.photo-zoom .photo-zoom-bar { cursor: move; touch-action: none; }
.photo-zoom-buttons, .photo-zoom-buttons form { display: flex; align-items: center; margin: 0; }
.photo-zoom-buttons { gap: 3px; }
.photo-zoom-buttons button {
    min-width: 22px;
    border: 1px solid #7b746e;
    padding: 0 3px;
    line-height: 16px;
    font-family: inherit;
    color: #fff;
    background: #443f3a;
    cursor: pointer;
}
.photo-zoom-viewport {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    background: #000;
    color: #fff;
    cursor: grab;
    touch-action: none;
    user-select: none;
}
.photo-zoom-viewport.is-panning { cursor: grabbing; }
.photo-zoom-viewport canvas { display: block; position: absolute; inset: 0; width: 100%; height: 100%; }
.photo-zoom-viewport p { position: absolute; inset: 12px auto auto 12px; margin: 0; }
