.gallery.gp-kg-gallery {
    display: grid !important;
    grid-template-columns: repeat(var(--gp-kg-columns, 3), minmax(0, 1fr));
    gap: 24px;
    width: 100%;
    margin: 24px 0 !important;
}
.gallery.gp-kg-gallery > br { display: none !important; }
.gallery.gp-kg-gallery .gallery-item {
    float: none !important;
    width: auto !important;
    max-width: none !important;
    min-width: 0;
    margin: 0 !important;
    text-align: center;
}
.gallery.gp-kg-gallery .gallery-icon { margin: 0; }
.gallery.gp-kg-gallery .gallery-icon a {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 220px;
    padding: 12px;
    border-radius: 12px;
    background: #f4f0f8;
}
.gallery.gp-kg-gallery .gallery-icon img {
    display: block;
    width: auto !important;
    height: auto !important;
    max-width: 100% !important;
    max-height: 240px;
    margin: 0 auto;
    object-fit: contain;
    border: 0 !important;
}
.gallery.gp-kg-gallery .gallery-caption { margin: 10px 0 0; }
.gp-kg-viewer {
    box-sizing: border-box;
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    max-width: none;
    max-height: none;
    margin: 0;
    padding: 64px 76px 60px;
    border: 0;
    background: rgba(18, 16, 23, .97);
    color: white;
}
.gp-kg-viewer:not([open]) { display: none; }
.gp-kg-viewer[open] { display: flex; align-items: center; justify-content: center; }
.gp-kg-viewer::backdrop { background: rgba(0, 0, 0, .85); }
.gp-kg-viewer figure {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    height: 100%;
    margin: 0;
    pointer-events: none;
}
.gp-kg-viewer img {
    display: block;
    max-width: 100%;
    max-height: calc(100% - 48px);
    width: auto;
    height: auto;
    object-fit: contain;
    pointer-events: auto;
}
.gp-kg-viewer figcaption { max-width: 100%; text-align: center; color: #fff; font-size: 16px; overflow-wrap: anywhere; }
.gp-kg-viewer button {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    padding: 0;
    border: 1px solid #8b8499;
    border-radius: 50%;
    background: #302b3b;
    color: white;
    font: 32px/1 sans-serif;
    cursor: pointer;
}
.gp-kg-viewer button:hover { background: #514460; }
.gp-kg-viewer button:focus-visible { outline: 3px solid #dbc6f7; outline-offset: 4px; }
.gp-kg-viewer button[hidden] { display: none; }
.gp-kg-close { top: 14px; right: 18px; }
.gp-kg-prev { top: calc(50% - 24px); left: 14px; }
.gp-kg-next { top: calc(50% - 24px); right: 14px; }
.gp-kg-count { position: absolute; bottom: 18px; left: 0; right: 0; text-align: center; font-size: 14px; }
@media (max-width: 760px) {
    .gallery.gp-kg-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
    .gallery.gp-kg-gallery .gallery-icon a { min-height: 160px; padding: 8px; }
    .gallery.gp-kg-gallery .gallery-icon img { max-height: 180px; }
    .gp-kg-viewer { padding: 68px 52px 52px; }
    .gp-kg-viewer button { width: 40px; height: 40px; }
    .gp-kg-prev { left: 4px; }
    .gp-kg-next { right: 4px; }
}
@media (max-width: 380px) {
    .gallery.gp-kg-gallery { grid-template-columns: minmax(0, 1fr); }
}
