.pitvu-profile-gallery [hidden], .pitvu-gallery-viewer [hidden] { display:none!important }
.pitvu-profile-gallery {min-width:0;max-width:100%}
.pitvu-profile-gallery .pitvu-gallery-thumb[aria-current=true] {border-color:var(--theme-link,#315c4b);opacity:1}
.pitvu-profile-gallery .pitvu-gallery-thumb {display:block;box-sizing:border-box}
.pitvu-profile-gallery :is(a,button):focus-visible, .pitvu-gallery-viewer button:focus-visible {outline:3px solid #cba76b!important;outline-offset:3px}
.pitvu-profile-gallery .pitvu-gallery-expand {min-height:44px!important}
.pitvu-profile-gallery .pitvu-gallery-caption {overflow-wrap:anywhere;margin-top:10px}
.pitvu-profile-gallery .pitvu-gallery-caption p {margin:6px 0}
.pitvu-gallery-open {overflow:hidden}
.pitvu-gallery-viewer {max-height:100dvh;overflow:auto}
.pitvu-gallery-viewer .pitvu-photo-viewer-image {object-fit:contain!important;max-height:calc(100dvh - 180px)!important;min-height:0}
.pitvu-gallery-viewer [data-viewer-caption] {color:#fff;max-width:75ch;font-size:.85rem;line-height:1.45;margin:8px auto;max-height:5em;overflow:auto;white-space:pre-line}
.pitvu-gallery-viewer .pitvu-photo-viewer-bar button {min-width:44px;min-height:44px}
.gallery-management {display:grid;gap:16px;margin:24px 0}
.gallery-management article {padding:14px;border:1px solid var(--theme-border,#d0d5ce);border-radius:8px;min-width:0;overflow-wrap:anywhere}
.gallery-management img {max-width:160px;max-height:130px;object-fit:contain}
.gallery-management form {display:flex;gap:8px;flex-wrap:wrap}
.gallery-management .button {min-height:44px}
@media (prefers-reduced-motion:reduce) {.pitvu-profile-gallery img {transition:none!important;transform:none!important}}
/* The site theme styles generic dialogs/buttons; keep viewer controls legible in both themes. */
:root body dialog.pitvu-gallery-viewer {background:#101d17!important;color:#fff!important}
:root body dialog.pitvu-gallery-viewer[open] {display:flex;flex-direction:column;gap:8px}
:root body dialog.pitvu-gallery-viewer .pitvu-photo-viewer-image {flex:1;min-height:0!important;height:0!important;max-height:none!important}
:root body dialog.pitvu-gallery-viewer [data-viewer-caption] {flex:0 1 auto;color:#fff!important}
:root body dialog.pitvu-gallery-viewer .pitvu-photo-viewer-bar {flex:0 0 50px;color:#fff!important}
:root body dialog.pitvu-gallery-viewer .pitvu-photo-viewer-bar button {background:#293c32!important;color:#fff!important;border:1px solid #9baaa1!important}
:root .historical-profile-header .pitvu-gallery-thumb[aria-current=true] {border-color:var(--theme-link,#315c4b);opacity:1}
