.mds-gallery {
    columns: var(--mds-gallery-size, 230px);
    column-gap: var(--mds-gallery-gap, 10px);
    margin: 0 0 24px;
    padding: 0;
}
.mds-gallery__item {
    break-inside: avoid;
    margin: 0 0 var(--mds-gallery-gap, 10px);
}
.mds-gallery__figure { margin: 0; padding: 0; }
.mds-gallery__link { display: block; color: inherit; }
.mds-gallery .mds-gallery__link img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    border: 0;
}
.mds-gallery__link:focus-visible { outline: 3px solid currentColor; outline-offset: 3px; }
.mds-gallery__caption { padding: 8px 2px; font-size: .9em; line-height: 1.45; overflow-wrap: anywhere; }
.mds-gallery--enhanced { position: relative; columns: auto; }
.mds-gallery--enhanced .mds-gallery__item {
    position: absolute;
    top: 0;
    left: 0;
    width: var(--mds-gallery-item-width);
    margin: 0;
}
.mds-gallery__notice { padding: 12px 0; }
.mds-gallery-admin-preview { margin-top: 20px; }
html.mds-gallery-open { overflow: hidden; }
.mds-gallery-dialog {
    box-sizing: border-box;
    width: min(1150px, calc(100vw - 32px));
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);
    margin: auto;
    padding: 14px;
    border: 1px solid #555;
    border-radius: 3px;
    background: #151515;
    color: #fff;
    box-shadow: 0 12px 48px #0008;
}
.mds-gallery-dialog::backdrop { background: #000d; }
.mds-gallery-dialog__toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.mds-gallery-dialog__status { margin: 0; font-size: 14px; color: #eee; }
.mds-gallery-dialog button {
    box-sizing: border-box;
    min-height: 44px;
    padding: 9px 14px;
    border: 1px solid #888;
    border-radius: 2px;
    background: #252525;
    color: #fff;
    font: inherit;
    line-height: 1.3;
    cursor: pointer;
}
.mds-gallery-dialog button:hover { background: #414141; }
.mds-gallery-dialog button:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.mds-gallery-dialog button[hidden] { display: none; }
.mds-gallery-dialog__figure { margin: 0; text-align: center; }
.mds-gallery-dialog .mds-gallery-dialog__image {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: calc(100vh - 220px);
    max-height: calc(100dvh - 220px);
    margin: auto;
    object-fit: contain;
}
.mds-gallery-dialog__caption { max-width: 80ch; margin: 12px auto 0; color: #eee; overflow-wrap: anywhere; }
.mds-gallery-dialog__navigation { display: flex; justify-content: space-between; gap: 16px; margin-top: 14px; }
.mds-gallery-dialog__sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
@media (max-width: 480px) {
    .mds-gallery-dialog { width: calc(100vw - 16px); max-width: calc(100vw - 16px); padding: 10px; }
    .mds-gallery-dialog .mds-gallery-dialog__image { max-height: calc(100dvh - 200px); }
}
