.gpg {
    --gpg-accent: #ffec02;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin: 28px 0;
    padding: 0;
    overflow: hidden;
    color: #f5f5f5;
    background: #191919;
    border: 1px solid #363636;
    border-radius: 12px;
    font: inherit;
    line-height: 1.5;
    text-align: left;
    isolation: isolate;
}
.gpg *, .gpg *::before, .gpg *::after { box-sizing: border-box; }
.gpg [hidden] { display: none !important; }
.gpg .gpg-stage { position: relative; width: 100%; background: #090909; touch-action: pan-y pinch-zoom; }
.gpg .gpg-stage::before { content: ""; display: block; padding-top: 56.25%; }
.gpg .gpg-slide { position: absolute; inset: 0; width: 100%; height: 100%; }
.gpg .gpg-image {
    display: block; width: 100%; height: 100%; max-width: 100%; max-height: 100%;
    margin: 0; padding: 0; border: 0; border-radius: 0; box-shadow: none;
    object-fit: contain; object-position: center; background: transparent;
}
.gpg .gpg-arrow {
    appearance: none; position: absolute; z-index: 2; top: 50%; transform: translateY(-50%);
    display: none; align-items: center; justify-content: center;
    width: 46px; height: 46px; min-width: 44px; min-height: 44px;
    margin: 0; padding: 0; border: 1px solid rgba(255,255,255,.35); border-radius: 9px;
    color: #fff; background: rgba(17,17,17,.85); box-shadow: 0 2px 12px rgba(0,0,0,.15);
    font: inherit; line-height: 1; cursor: pointer; transition: background .15s, border-color .15s;
}
.gpg.gpg-is-ready .gpg-arrow { display: flex; }
.gpg .gpg-arrow:hover { background: #191919; color: #fff; border-color: var(--gpg-accent); }
.gpg .gpg-prev { left: 14px; }
.gpg .gpg-next { right: 14px; }
.gpg .gpg-arrow svg { width: 24px; height: 24px; }
.gpg svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.gpg .gpg-meta { display: flex; align-items: center; gap: 16px; min-height: 56px; padding: 12px 16px; }
.gpg .gpg-counter { flex: 0 0 auto; color: #f5f5f5; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.gpg .gpg-caption {
    position: absolute; z-index: 1; left: 0; right: 0; bottom: 0;
    min-width: 0; max-height: 40%; overflow-y: auto; padding: 10px 14px; margin: 0;
    color: #fff; background: rgba(0, 0, 0, 0.1); border-radius: 0;
    font: inherit; font-size: 13px; font-weight: 500; line-height: 1.5;
    text-shadow: 0 1px 3px rgba(0,0,0,.85); overflow-wrap: anywhere;
}
.gpg button.gpg-full {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    flex: 0 0 auto; min-height: 32px; margin-left: auto; padding: 2px 0;
    color: #d8d8d8; background: none; border: 0; box-shadow: none;
    appearance: none; border-radius: 0; font: inherit; font-size: 12px; font-weight: 500; text-decoration: none; cursor: pointer;
}
.gpg button.gpg-full:hover { color: #fff; background: none; text-decoration: underline; }
.gpg .gpg-full svg { width: 15px; height: 15px; }
.gpg .gpg-thumbs {
    display: flex; align-items: flex-start; gap: 8px; width: 100%; min-width: 0;
    padding: 2px 16px 16px; margin: 0; overflow-x: auto; overscroll-behavior-x: contain;
    scrollbar-width: thin; scrollbar-color: #656565 #191919;
    -webkit-overflow-scrolling: touch;
}
.gpg .gpg-thumbs::-webkit-scrollbar { height: 6px; }
.gpg .gpg-thumbs::-webkit-scrollbar-thumb { background: #656565; border-radius: 8px; }
.gpg button.gpg-thumb {
    position: relative; display: block; flex: 0 0 106px; width: 106px; height: 64px;
    padding: 3px; margin: 0; overflow: hidden; border: 2px solid transparent; border-radius: 7px;
    appearance: none; color: #fff; background: #292929; box-shadow: none; text-decoration: none; cursor: pointer; font: inherit;
    transition: border-color .15s;
}
.gpg button.gpg-thumb:hover { border-color: #8c8c8c; }
.gpg button.gpg-thumb[aria-current="true"] { border-color: var(--gpg-accent); }
.gpg button:disabled { cursor: default; }
.gpg .gpg-thumb img { display: block; width: 100%; height: 100%; max-width: 100%; max-height: 100%; object-fit: cover; margin: 0; padding: 0; border: 0; border-radius: 2px; box-shadow: none; }
.gpg .gpg-thumb-number { position: absolute; bottom: 5px; right: 5px; min-width: 17px; padding: 0 4px; border-radius: 3px; color: #fff; background: rgba(0,0,0,.8); font: 10px/17px sans-serif; text-align: center; }
.gpg button:focus-visible { outline: 3px solid #fff; outline-offset: -3px; }
.gpg .gpg-feedback { position: absolute; z-index: 1; left: 68px; right: 68px; top: 50%; transform: translateY(-50%); margin: 0; padding: 12px; color: #eee; background: #191919; border-radius: 6px; font-size: 13px; line-height: 1.6; text-align: center; }
.gpg .gpg-sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
@media (max-width: 600px) {
    .gpg { margin: 20px 0; border-radius: 9px; }
    .gpg .gpg-arrow { width: 44px; height: 44px; }
    .gpg .gpg-prev { left: 8px; }
    .gpg .gpg-next { right: 8px; }
    .gpg .gpg-meta { flex-wrap: wrap; gap: 6px 12px; padding: 9px 12px; min-height: 50px; }
    .gpg .gpg-caption { padding: 7px 10px; font-size: 12px; }
    .gpg .gpg-thumbs { padding: 2px 12px 12px; gap: 6px; }
    .gpg button.gpg-thumb { flex-basis: 82px; width: 82px; height: 52px; }
    .gpg .gpg-feedback { left: 57px; right: 57px; padding: 7px; font-size: 11px; }
}
dialog.gpg-lightbox {
    box-sizing: border-box; position: fixed; inset: 0; z-index: 2147483000;
    width: 100%; height: 100vh; height: 100dvh; max-width: none; max-height: none;
    margin: 0; padding: 64px; border: 0; border-radius: 0; overflow: auto;
    background: rgba(0,0,0,.94); color: #fff; font: 14px/1.5 Arial, sans-serif;
    overscroll-behavior: contain;
}
dialog.gpg-lightbox:not([open]) { display: none; }
dialog.gpg-lightbox[open] { display: flex; align-items: center; justify-content: center; }
dialog.gpg-lightbox::backdrop { background: rgba(0,0,0,.5); }
.gpg-lightbox *, .gpg-lightbox *::before, .gpg-lightbox *::after { box-sizing: border-box; }
.gpg-lightbox [hidden] { display: none !important; }
.gpg-lightbox .gpg-lightbox-stage { position: relative; display: flex; justify-content: center; align-items: center; width: 100%; min-height: 140px; }
.gpg-lightbox .gpg-lightbox-figure { position: relative; width: fit-content; max-width: 100%; margin: 0; padding: 0; line-height: 0; }
.gpg-lightbox .gpg-lightbox-image { display: block; width: auto; height: auto; max-width: 100%; max-height: calc(100vh - 128px); max-height: calc(100dvh - 128px); margin: 0; padding: 0; border: 0; border-radius: 0; object-fit: contain; box-shadow: none; }
.gpg-lightbox .gpg-lightbox-caption { position: absolute; bottom: 0; left: 0; right: 0; max-height: 40%; overflow-y: auto; margin: 0; padding: 10px 14px; background: rgba(0, 0, 0, 0.1); color: #fff; font: 500 14px/1.5 Arial, sans-serif; border-radius: 0; text-shadow: 0 1px 3px rgba(0,0,0,.85); overflow-wrap: anywhere; }
.gpg-lightbox button {
    position: absolute; z-index: 3; display: flex; align-items: center; justify-content: center;
    appearance: none; width: 48px; height: 48px; margin: 0; padding: 0;
    border: 1px solid #777; border-radius: 8px; color: #fff; background: #191919;
    box-shadow: none; font: inherit; cursor: pointer;
}
.gpg-lightbox button:hover { color: #fff; background: #333; border-color: #fff; }
.gpg-lightbox button:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.gpg-lightbox svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.gpg-lightbox .gpg-lightbox-close { top: 12px; right: 12px; top: max(12px, env(safe-area-inset-top)); right: max(12px, env(safe-area-inset-right)); }
.gpg-lightbox .gpg-lightbox-prev { left: 8px; top: 50%; transform: translateY(-50%); }
.gpg-lightbox .gpg-lightbox-next { right: 8px; top: 50%; transform: translateY(-50%); }
.gpg-lightbox .gpg-lightbox-counter { position: absolute; left: 0; right: 0; bottom: 12px; bottom: max(12px, env(safe-area-inset-bottom)); margin: 0; padding: 0; color: #fff; font: 13px/1.5 Arial, sans-serif; text-align: center; }
.gpg-lightbox .gpg-lightbox-error { margin: 0; padding: 12px; color: #fff; font: 14px/1.6 Arial, sans-serif; text-align: center; }
@media (max-width: 600px) {
    dialog.gpg-lightbox { padding: 70px 8px; }
    .gpg-lightbox .gpg-lightbox-image { max-height: calc(100vh - 140px); max-height: calc(100dvh - 140px); }
    .gpg-lightbox .gpg-lightbox-caption { font-size: 12px; padding: 7px 10px; }
    .gpg-lightbox button { width: 44px; height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
    .gpg *, .gpg *::before, .gpg *::after { transition: none !important; scroll-behavior: auto !important; }
}
