* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body.pv-lock {
    overflow: hidden;
}

body.pv-lock .site-header {
    visibility: hidden;
    pointer-events: none;
}

.photos-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}
.photos-meta {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
}
.photos-count {
    top: 0;
}
.photos-skip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-family: var(--font-body);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
    background: transparent;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    padding: 5px 12px;
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.15s, border-color 0.15s;
}
.photos-skip:hover {
    color: var(--brand-red);
    border-color: var(--brand-red);
}
.photos-skip i {
    font-size: 10px;
}

#thumbnail-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    grid-auto-flow: dense;
    gap: 8px;
    margin-top: 18px;
    margin-bottom: 60px;
}
.thumbnail-images {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 3 / 4;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--panel);
    overflow: hidden;
    cursor: zoom-in;
    font: inherit;
    color: inherit;
    -webkit-tap-highlight-color: transparent;
    transition: border-color 0.18s ease, transform 0.18s ease;
}
.thumbnail-images.landscape {
    grid-column: span 2;
    aspect-ratio: 3 / 2;
}
.thumbnail-images img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.thumbnail-images:focus-visible {
    outline: 2px solid var(--brand-red);
    outline-offset: 2px;
}
@media (hover: hover) {
    .thumbnail-images:hover {
        border-color: var(--brand-red);
        transform: translateY(-3px);
    }
}
@media (max-width: 349px) {
    .thumbnail-images.landscape {
        grid-column: auto;
    }
}
@media (min-width: 768px) {
    #thumbnail-container {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 10px;
    }
}
@media (min-width: 1200px) {
    #thumbnail-container {
        grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
        gap: 12px;
    }
}

.gallery-container {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: none;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    background: radial-gradient(140% 110% at 50% 40%, #241b30 0%, #140e1a 68%, #0e0912 100%);
}
.gallery-container.show {
    display: block;
}

.pv-progress {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    z-index: 3;
    background: rgba(255, 250, 240, 0.08);
}
.pv-progress-fill {
    display: block;
    height: 100%;
    background: var(--pink);
    transform: scaleX(0);
    transform-origin: left;
    will-change: transform;
}

.pv-top {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: max(14px, env(safe-area-inset-top)) 14px 22px;
    background: linear-gradient(to bottom, rgba(14, 9, 18, 0.78), rgba(14, 9, 18, 0));
    transition: opacity 0.18s ease, transform 0.18s ease;
}
.pv-counter {
    display: flex;
    align-items: baseline;
    gap: 8px;
    min-width: 0;
}
.pv-frame-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--brand-red);
}
.pv-frame-input {
    width: 62px;
    min-width: 0;
    padding: 2px 5px;
    border: 1px solid rgba(255, 250, 240, 0.16);
    border-radius: 8px;
    outline: none;
    background: rgba(255, 250, 240, 0.07);
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 26px;
    line-height: 1;
    color: var(--ink);
    text-align: center;
    font-variant-numeric: tabular-nums;
    appearance: textfield;
}
.pv-frame-input::-webkit-inner-spin-button,
.pv-frame-input::-webkit-outer-spin-button {
    margin: 0;
    appearance: none;
}
.pv-frame-input:focus {
    border-color: var(--brand-red);
    box-shadow: 0 0 0 2px rgba(217, 45, 53, 0.22);
}
.pv-frame-total {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 17px;
    color: var(--muted);
}
.pv-tools {
    display: flex;
    align-items: center;
    gap: 7px;
}
.pv-btn {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid rgba(255, 250, 240, 0.15);
    background: rgba(255, 250, 240, 0.07);
    color: var(--ink);
    font-size: 15px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.pv-btn:hover {
    background: rgba(255, 250, 240, 0.14);
}
.pv-btn:focus-visible {
    outline: 2px solid var(--brand-red);
    outline-offset: 2px;
}
.pv-btn.is-playing {
    background: var(--pink);
    border-color: var(--pink);
    color: #fff;
}
.pv-speed {
    width: auto;
    padding: 0 15px;
    border-radius: 999px;
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.04em;
    font-variant-numeric: tabular-nums;
}
.pv-btn.is-off {
    color: var(--muted);
    background: rgba(255, 250, 240, 0.03);
    border-color: rgba(255, 250, 240, 0.08);
}
.pv-btn.is-off i {
    opacity: 0.55;
}
.gallery-container.progress-off .pv-progress {
    display: none;
}

.pv-stage {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    touch-action: pinch-zoom;
}
.active-image {
    display: block;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    user-select: none;
    -webkit-user-drag: none;
    filter: drop-shadow(0 18px 40px rgba(0, 0, 0, 0.5));
}
.gallery-container.show .active-image {
    animation: pv-open 0.18s ease;
}
@keyframes pv-open {
    from {
        opacity: 0;
        transform: scale(0.985);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.pv-nav {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 22%;
    max-width: 240px;
    display: flex;
    align-items: center;
    border: 0;
    background: transparent;
    color: var(--ink);
    cursor: pointer;
    z-index: 1;
    -webkit-tap-highlight-color: transparent;
}
.pv-prev {
    left: 0;
    justify-content: flex-start;
    padding-left: 12px;
}
.pv-next {
    right: 0;
    justify-content: flex-end;
    padding-right: 12px;
}
.pv-nav i {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid rgba(255, 250, 240, 0.16);
    background: rgba(14, 9, 18, 0.6);
    font-size: 15px;
    opacity: 0;
    transition: opacity 0.15s ease;
}
@media (hover: hover) {
    .pv-stage:hover .pv-nav i {
        opacity: 0.9;
    }
}
.pv-nav:focus-visible {
    outline: none;
}
.pv-nav:focus-visible i {
    opacity: 1;
    outline: 2px solid var(--brand-red);
    outline-offset: 2px;
}

.pv-like {
    position: absolute;
    right: 14px;
    bottom: calc(92px + env(safe-area-inset-bottom));
    z-index: 3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-width: 52px;
    height: 48px;
    padding: 0 14px;
    border: 1px solid rgba(255, 250, 240, 0.2);
    border-radius: 999px;
    background: rgba(14, 9, 18, 0.78);
    color: var(--ink);
    font: 700 13px/1 var(--font-body);
    cursor: pointer;
    backdrop-filter: blur(10px);
    -webkit-tap-highlight-color: transparent;
    transition: color 0.16s, background 0.16s, border-color 0.16s,
                transform 0.16s, opacity 0.18s;
}
.pv-like i {
    font-size: 20px;
}
.pv-like:hover,
.pv-like:focus-visible {
    border-color: var(--pink);
    outline: none;
}
.pv-like.is-liked {
    border-color: var(--pink);
    background: var(--pink);
    color: #fff;
}
.pv-like.is-busy {
    opacity: 0.65;
    pointer-events: none;
}
.pv-like.pulse {
    animation: pv-like-pulse 0.32s ease-out;
}
@keyframes pv-like-pulse {
    45% { transform: scale(1.16); }
}
.pv-like-status {
    position: absolute;
    right: 17px;
    bottom: calc(148px + env(safe-area-inset-bottom));
    z-index: 3;
    min-height: 16px;
    color: var(--ink);
    font: 700 12px/1 var(--font-body);
    text-shadow: 0 1px 8px #000;
    pointer-events: none;
}
.pv-swipe-heart {
    position: fixed;
    z-index: 5;
    color: var(--pink);
    font-size: 42px;
    pointer-events: none;
    transform: translate(-50%, -50%);
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.45));
    animation: pv-heart-rise 0.75s ease-out forwards;
}
@keyframes pv-heart-rise {
    from { opacity: 0; transform: translate(-50%, -15%) scale(0.65); }
    25% { opacity: 1; transform: translate(-50%, -55%) scale(1.12); }
    to { opacity: 0; transform: translate(-50%, -180%) scale(1); }
}

.pv-strip {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 18px 12px max(12px, env(safe-area-inset-bottom));
    background: linear-gradient(to top, rgba(14, 9, 18, 0.8), rgba(14, 9, 18, 0));
    overflow-x: auto;
    scrollbar-width: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
}
.pv-strip::-webkit-scrollbar {
    display: none;
}
.pv-thumb:first-child {
    margin-left: auto;
}
.pv-thumb:last-child {
    margin-right: auto;
}
.pv-thumb {
    flex: none;
    width: 42px;
    height: 58px;
    padding: 0;
    border: 1px solid rgba(255, 250, 240, 0.12);
    border-radius: 8px;
    background: var(--panel);
    overflow: hidden;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.15s, border-color 0.15s, box-shadow 0.15s;
    -webkit-tap-highlight-color: transparent;
}
.pv-thumb.landscape {
    width: 76px;
}
.pv-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.pv-thumb.is-current {
    opacity: 1;
    border-color: var(--brand-red);
    box-shadow: 0 0 0 2px var(--brand-red);
}
.pv-thumb:focus-visible {
    outline: 2px solid var(--brand-red);
    outline-offset: 2px;
    opacity: 1;
}
@media (min-width: 768px) {
    .pv-strip {
        gap: 8px;
        padding: 20px 16px max(14px, env(safe-area-inset-bottom));
    }
    .pv-thumb {
        width: 48px;
        height: 64px;
    }
    .pv-thumb.landscape {
        width: 86px;
    }
}

.gallery-container.chrome-off .pv-top {
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
}
.gallery-container.chrome-off .pv-strip {
    opacity: 0;
    transform: translateY(8px);
    pointer-events: none;
}
.gallery-container.chrome-off .pv-like,
.gallery-container.chrome-off .pv-like-status {
    opacity: 0;
    transform: translateY(8px);
    pointer-events: none;
}
.gallery-container.chrome-off .pv-nav i {
    opacity: 0 !important;
}

@media (prefers-reduced-motion: reduce) {
    .thumbnail-images,
    .pv-top,
    .pv-strip,
    .pv-thumb,
    .pv-like,
    .pv-nav i {
        transition: none;
    }
    .thumbnail-images:hover {
        transform: none;
    }
    .gallery-container.show .active-image {
        animation: none;
    }
    .pv-like.pulse,
    .pv-swipe-heart {
        animation: none;
    }
}
