.ag-gallery-preview { position: relative; isolation: isolate; display: block; width: 100%; padding: 0; border: 0; background: transparent; cursor: pointer; }
.ag-gallery-preview img { display: block; width: 100%; }
.ag-gallery-lock { position: absolute; z-index: 2; inset: 0; display: flex; align-items: center; justify-content: center; color: #c62828; font-size: 2rem; text-shadow: 0 1px 3px white; }
.ag-gallery-badge { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 14px; border-radius: 24px; background: rgba(255, 255, 255, .95); color: #c62828; font-size: 15px; font-weight: 600; line-height: 1.4; text-shadow: none; box-shadow: 0 2px 8px rgba(0, 0, 0, .25); }
.grid-gallery-preview .ag-gallery-preview { height: 150px; overflow: hidden; }
.grid-gallery-preview .ag-gallery-preview img { height: 100%; object-fit: cover; }
.ag-gallery-unlocked { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 24px; background-color: #198754; color: #fff; text-shadow: none; }
#ls-list-gallery .card-status-badge.ag-gallery-private { display: inline-flex; align-items: center; gap: 6px; background-color: #fde8e8; color: #c62828; border-color: #c62828; }
.ag-gallery-password-dialog { max-width: min(420px, 90vw); border: 0; border-radius: 8px; padding: 24px; }
.ag-gallery-password-dialog::backdrop { background: #0008; }
.ag-gallery-password-dialog input { display: block; width: 100%; margin: 8px 0; }
.ag-gallery-password-dialog [role=alert] { color: #b71c1c; }

.ag-gallery-lock { pointer-events: none; }

.ag-gallery-modal .modal-content { background-color: #121212; color: #fff; }
.ag-gallery-modal .modal-header { border-bottom: 0; padding: 24px; }
.ag-gallery-modal .modal-header .modal-title { flex: 1; margin: 0; color: #fff; text-align: center; font-size: 28px; }
.ag-gallery-modal .btn-close { flex-shrink: 0; opacity: .8; }
.ag-gallery-modal .btn-close:hover { opacity: 1; }
.ag-gallery-modal .wiki-single-slider-nav img { height: 96px; width: auto; object-fit: contain; }

.ag-gallery-metadata { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 12px; }
.ag-gallery-metadata dt, .ag-gallery-metadata dd { margin: 0; overflow-wrap: anywhere; }
.ag-gallery-main { display: flex; align-items: center; justify-content: center; min-height: 220px; }
.ag-gallery-main img { max-height: 460px; width: auto; max-width: 100%; object-fit: contain; }
.ag-gallery-caption { margin: 12px 0; text-align: center; overflow-wrap: anywhere; font-size: .9em; }
.ag-gallery-thumbnails { display: flex; gap: 8px; overflow-x: auto; padding: 4px 4px 12px; }
.ag-gallery-thumbnail { flex: 0 0 72px; height: 72px; padding: 3px; border: 2px solid transparent; background: #f4f4f4; border-radius: 3px; }
.ag-gallery-thumbnail[aria-pressed="true"] { border-color: #121633; }
.ag-gallery-thumbnail img { width: 100%; height: 100%; object-fit: cover; }
.ag-gallery-thumbnail:focus-visible { outline: 2px solid #121633; outline-offset: 2px; }
.ag-gallery-description { margin-top: 12px; }
@media (max-width: 575px) {
    .ag-gallery-metadata { grid-template-columns: 1fr; gap: 0; }
    .ag-gallery-metadata dd { margin-bottom: 10px; }
}
