.tdt-photo-ready {
    position: relative;
    cursor: zoom-in;
}
.tdt-photo-enlarge { display: none; }
.tdt-photo-ready .tdt-photo-enlarge {
    position: absolute;
    inset: auto 14px 14px auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 13px;
    color: #fff;
    background: #112b48;
    border: 1px solid #ffffff75;
    border-radius: 24px;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.4;
}
.tdt-photo-enlarge svg { width: 18px; height: 18px; }
.tdt-photo-ready:is(:hover, :focus-visible) .tdt-photo-enlarge { background: #2267a5; }

html.tdt-viewer-open { overflow: hidden; }
.tdt-photo-viewer:not([open]) { display: none; }
.tdt-photo-viewer[open] {
    position: fixed;
    inset: 0;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    width: min(1150px, calc(100% - 48px));
    height: min(860px, calc(100dvh - 48px));
    max-width: none;
    max-height: none;
    padding: 14px 18px;
    margin: auto;
    overflow: hidden;
    color-scheme: dark;
    color: #f5f8ff;
    background: #0e2340;
    border: 1px solid #667c96;
    border-radius: 16px;
    box-shadow: 0 24px 84px #040b19b3;
    animation: tdt-viewer-appear 160ms ease-out;
}
.tdt-photo-viewer::backdrop { background: rgb(5 14 27 / 86%); }
@keyframes tdt-viewer-appear {
    from { opacity: 0; transform: scale(.985); }
    to { opacity: 1; transform: scale(1); }
}
.tdt-viewer-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 0 0 12px 3px;
}
.tdt-viewer-bar p, .tdt-viewer-nav p, .tdt-viewer-stage p {
    margin: 0;
    color: inherit;
}
.tdt-viewer-bar p { font-weight: 700; font-size: 15px; }
.tdt-viewer-stage {
    display: grid;
    place-items: center;
    overflow: hidden;
    border-radius: 9px;
    background: #091728;
    touch-action: pan-y pinch-zoom;
}
.tdt-viewer-stage img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    min-height: 0;
    object-fit: contain;
    user-select: none;
}
.tdt-viewer-stage img:not([src]) { visibility: hidden; }
.tdt-viewer-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 18px;
    padding-top: 12px;
}
.tdt-viewer-count {
    min-width: 5ch;
    text-align: center;
    font-variant-numeric: tabular-nums;
    font-size: 14px;
}
.tdt-photo-viewer button {
    display: inline-grid;
    width: 44px;
    height: 44px;
    place-content: center;
    padding: 0;
    color: #fff;
    background: #1a3556;
    border: 1px solid #7289a4;
    border-radius: 50%;
    cursor: pointer;
}
.tdt-photo-viewer button:hover { background: #2267a5; }
.tdt-page .tdt-photo-viewer button:focus-visible { outline-color: #c8e5ff; outline-offset: 2px; }
.tdt-photo-viewer button svg { display: block; width: 22px; height: 22px; }
.tdt-viewer-prev svg { transform: rotate(90deg); }
.tdt-viewer-next svg { transform: rotate(-90deg); }
@media (max-width: 640px) {
    .tdt-photo-ready .tdt-photo-enlarge { inset: auto 9px 9px auto; }
    .tdt-photo-viewer[open] {
        width: calc(100% - 20px);
        height: calc(100dvh - 24px);
        padding: 10px;
        border-radius: 13px;
    }
}
@media (prefers-reduced-motion: reduce) {
    .tdt-photo-viewer[open] { animation: none; }
}
