.p77cg-gallery,
.p77cg-dialog {
    --p77cg-brand: #31459c;
    --p77cg-control-bg: rgba(14, 21, 42, .75);
    --p77cg-gap: 10px;
    box-sizing: border-box;
    font: inherit;
    letter-spacing: normal;
}

.p77cg-gallery *,
.p77cg-dialog * { box-sizing: border-box; }
.p77cg-gallery [hidden], .p77cg-dialog [hidden] { display: none !important; }
.p77cg-gallery { position: relative; width: 100%; min-width: 0; }

.p77cg-main {
    position: relative;
    isolation: isolate;
    height: var(--p77cg-height-desktop, 480px);
    overflow: hidden;
    border-radius: 20px;
    background: #172038;
    touch-action: pan-y pinch-zoom;
}

.p77cg-visual {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    overflow: hidden;
    background: #172038;
    color: #fff;
    cursor: zoom-in;
    text-decoration: none !important;
}

.p77cg-visual:has(.p77cg-frame:not([inert]) .p77cg-play) { cursor: pointer; }
.p77cg-visual:focus-visible { outline: 3px solid #aabaff; outline-offset: -5px; }
.p77cg-visual > *, .p77cg-frame { pointer-events: none; }
.p77cg-frame {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template: minmax(0, 1fr) / minmax(0, 1fr);
    place-items: center;
    overflow: hidden;
    background: inherit;
}
.p77cg-stage-media .p77cg-frame:not([inert]) > :is(button, video, iframe, .p77cg-error) { pointer-events: auto; }
.p77cg-gallery .p77cg-main-image {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    min-height: 0;
    object-fit: var(--p77cg-fit, cover);
    object-position: center;
    border-radius: 0;
}
.p77cg-gallery button.p77cg-control,
.p77cg-dialog button.p77cg-control {
    display: grid;
    place-items: center;
    padding: 0;
    margin: 0;
    border: 1px solid rgba(255, 255, 255, .28);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    background: var(--p77cg-control-bg);
    color: #fff;
    box-shadow: none;
    line-height: 1;
    text-transform: none;
    cursor: pointer;
    touch-action: manipulation;
}

.p77cg-gallery button.p77cg-control:hover,
.p77cg-dialog button.p77cg-control:hover { background: var(--p77cg-brand); color: #fff; }
.p77cg-gallery button:focus-visible, .p77cg-dialog button:focus-visible { outline: 2px solid #aabaff; outline-offset: 2px; }

.p77cg-arrows {
    position: absolute;
    z-index: 2;
    inset: 50% 0 auto;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    gap: 8px;
    padding-inline: 12px;
    pointer-events: none;
}

:is(.p77cg-gallery, .p77cg-dialog) .p77cg-arrows > button.p77cg-control {
    width: var(--p77cg-arrow-size, 60px);
    height: var(--p77cg-arrow-size, 60px);
    border: 0;
    background: #00000050;
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
    opacity: 0;
    transform: scale(.8);
    pointer-events: none;
    transition: opacity .3s ease, transform .3s ease, background-color .3s ease;
}

.p77cg-arrows > .p77cg-control[aria-disabled="true"] {
    --p77cg-arrow-opacity: .35;
    cursor: default;
}

@media (hover: hover) and (pointer: fine) {
    :is(.p77cg-main, .p77cg-stage):hover .p77cg-arrows > button.p77cg-control {
        opacity: var(--p77cg-arrow-opacity, 1);
        transform: scale(1);
        pointer-events: auto;
    }
    :is(.p77cg-gallery, .p77cg-dialog) .p77cg-arrows > button.p77cg-control:hover { background: #00000090; }
}

.p77cg-arrows > button.p77cg-control:focus-visible {
    opacity: var(--p77cg-arrow-opacity, 1);
    transform: scale(1);
}

.p77cg-arrows .p77cg-control::before {
    content: "";
    display: block;
    width: 13px;
    height: 13px;
    border-top: 3px solid currentColor;
    border-right: 3px solid currentColor;
}
.p77cg-prev::before, .p77cg-reverse .p77cg-next::before { transform: translateX(-2px) rotate(45deg); }
.p77cg-next::before, .p77cg-reverse .p77cg-prev::before { transform: translateX(2px) rotate(-135deg); }
.p77cg-arrows.p77cg-reverse { flex-direction: row-reverse; }

.p77cg-triangle {
    display: block;
    width: 0;
    height: 0;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-left: 9px solid currentColor;
}

.p77cg-play {
    position: absolute;
    z-index: 1;
    inset-block-start: 50%;
    inset-inline-start: 50%;
    transform: translate(50%, -50%);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    background: var(--p77cg-control-bg);
    border: 1px solid rgba(255, 255, 255, .32);
    border-radius: 999px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}

.p77cg-thumbs {
    display: grid;
    grid-template-columns: repeat(var(--p77cg-columns, 4), minmax(0, 1fr));
    gap: var(--p77cg-gap);
    margin-top: 12px;
}

.p77cg-gallery button.p77cg-thumb,
.p77cg-dialog button.p77cg-thumb {
    position: relative;
    min-width: 0;
    padding: 0;
    margin: 0;
    display: grid;
    place-items: center;
    height: 150px;
    overflow: hidden;
    background: #18223a;
    color: #fff;
    border: 0;
    border-radius: 16px;
    box-shadow: none;
    font: inherit;
    cursor: pointer;
    touch-action: manipulation;
}

.p77cg-gallery .p77cg-thumb[aria-current="true"],
.p77cg-dialog .p77cg-thumb[aria-current="true"] { background: #2a3655; }
.p77cg-gallery .p77cg-thumb img,
.p77cg-dialog .p77cg-thumb img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0;
    opacity: .76;
}
.p77cg-thumb:is(:hover, [aria-current="true"]) img { opacity: 1; }

.p77cg-thumb-video,
.p77cg-more {
    position: relative;
    display: grid;
    place-items: center;
    background: rgba(14, 21, 42, .7);
    color: #fff;
}
.p77cg-thumb-video { width: 30px; height: 30px; border-radius: 100%; }
.p77cg-more {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: clamp(13px, 4vw, 21px);
    font-weight: 700;
}
.p77cg-more .p77cg-thumb-video { width: auto; height: auto; background: none; }

.p77cg-dialog {
    --p77cg-popup-edge: clamp(8px, 2vw, 20px);
    --p77cg-popup-left: max(var(--p77cg-popup-edge), env(safe-area-inset-left, 0px));
    --p77cg-popup-right: max(var(--p77cg-popup-edge), env(safe-area-inset-right, 0px));
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    max-width: none;
    max-height: none;
    padding: 0;
    margin: 0;
    border: 0;
    border-radius: 0;
    background: #080d19;
    color: #fff;
    overflow: hidden;
}
.p77cg-dialog::backdrop { background: #080d19; }
html.p77cg-dialog-open, html.p77cg-dialog-open body { overflow: hidden !important; }

.p77cg-dialog-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr) auto;
    height: 100%;
}
.p77cg-dialog-header, .p77cg-dialog-title { display: flex; gap: 12px; align-items: center; min-width: 0; }
.p77cg-dialog-header {
    grid-area: 1 / 1;
    z-index: 3;
    justify-content: space-between;
    padding: max(8px, env(safe-area-inset-top, 0px)) var(--p77cg-popup-right) 12px var(--p77cg-popup-left);
    background: linear-gradient(180deg, rgba(5, 9, 17, .82), rgba(5, 9, 17, .44) 70%, transparent);
    pointer-events: none;
}
.p77cg-dialog-title strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #fff; }
.p77cg-counter { color: #e3e9fa; white-space: nowrap; font-size: 13px; }
.p77cg-dialog .p77cg-close { flex: 0 0 auto; font-size: 27px; pointer-events: auto; }

.p77cg-stage {
    grid-area: 1 / 1 / 4 / 2;
    position: relative;
    isolation: isolate;
    min-height: 0;
    background: #080d19;
    overflow: hidden;
    touch-action: pan-y pinch-zoom;
}
.p77cg-dialog[data-p77cg-playing-video] .p77cg-stage { grid-row: 2 / 3; }
.p77cg-dialog .p77cg-arrows { padding-right: var(--p77cg-popup-right); padding-left: var(--p77cg-popup-left); }
.p77cg-stage-media { position: absolute; inset: 0; background: inherit; }
.p77cg-stage-media img, .p77cg-stage-media video, .p77cg-stage-media iframe {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 0;
    object-fit: contain;
    border: 0;
    border-radius: 0;
}
.p77cg-stage-media img { object-fit: var(--p77cg-popup-fit, cover); }
.p77cg-stage-media video, .p77cg-stage-media iframe { touch-action: auto; }
.p77cg-stage:has(video, iframe) { touch-action: auto; }
.p77cg-stage-media iframe { height: auto; max-height: 100%; aspect-ratio: 16 / 9; }
.p77cg-stage-media .p77cg-play { font-family: inherit; cursor: pointer; }
.p77cg-stage-media .p77cg-play:hover { background: var(--p77cg-brand); color: #fff; }
.p77cg-stage-media .p77cg-error { padding: 14px; color: #e3e9ff; text-align: center; }
.p77cg-error a { color: #bfcaff; text-decoration: underline; }

.p77cg-popup-thumbs {
    grid-area: 3 / 1;
    z-index: 3;
    display: flex;
    gap: var(--p77cg-gap);
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
    scrollbar-color: #6474a7 #101728;
    padding: 9px var(--p77cg-popup-right) max(10px, env(safe-area-inset-bottom, 0px)) var(--p77cg-popup-left);
    background: linear-gradient(0deg, rgba(5, 9, 17, .85), rgba(5, 9, 17, .44) 90%, transparent);
}
.p77cg-dialog .p77cg-popup-thumbs .p77cg-thumb {
    flex: 0 0 calc((100% - (var(--p77cg-columns, 7) - 1) * var(--p77cg-gap)) / var(--p77cg-columns, 7));
    height: min(90px, 16vh);
    border-radius: 9px;
}

.p77cg-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    white-space: nowrap;
    clip-path: inset(50%);
}

@media (max-width: 768px) {
    .p77cg-gallery, .p77cg-dialog { --p77cg-gap: 6px; }
    .p77cg-main { height: var(--p77cg-height-mobile, 265px); border-radius: 16px; }
    .p77cg-gallery button.p77cg-thumb { height: 82px; border-radius: 10px; }
    .p77cg-thumb-video { width: 24px; height: 24px; }
    .p77cg-dialog .p77cg-popup-thumbs .p77cg-thumb { height: min(72px, 15vh); }
    .p77cg-arrows { --p77cg-arrow-size: 45px; padding-inline: 5px; }
    .p77cg-arrows .p77cg-control::before { width: 9px; height: 9px; border-width: 2px; }
}

@media (prefers-reduced-motion: reduce) {
    :is(.p77cg-gallery, .p77cg-dialog) .p77cg-arrows > button.p77cg-control { transition: none; }
}
