#gallery { margin-top: calc(var(--tf-topbar-height, 38px) + var(--tf-header-height, 78px)); min-height: 50vh; color: #183346; }
.media-card { background: white; border: 1px solid #dce5eb; border-radius: 12px; overflow: hidden; }
.media-preview { position: relative; aspect-ratio: 16/9; background: #152331; }
.media-preview video, .media-preview iframe { width: 100%; height: 100%; border: 0; object-fit: contain; pointer-events: none; }
.preview-launch { position: absolute; inset: 0; width: 100%; border: 0; background: #0002; color: white; display: grid; place-items: center; }
.preview-launch span { background: #102b40e8; padding: .65rem 1rem; border-radius: 30px; }
.preview-launch:hover { background: #0005; }
#gallery button:focus-visible, #media-viewer button:focus-visible { outline: 3px solid #49c4ef; outline-offset: -3px; }
#media-viewer { position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: #080e16; color: white; }
#media-viewer[open] { display: flex; flex-direction: column; }
#media-viewer::backdrop { background: #080e16; }
.viewer-header, .viewer-controls { display: flex; align-items: center; gap: 1rem; padding: 1rem; flex-shrink: 0; }
.viewer-header { justify-content: space-between; }
.viewer-controls { justify-content: center; flex-wrap: wrap; }
#viewer-stage { flex: 1; min-height: 0; display: flex; }
#viewer-stage video, #viewer-stage iframe { width: 100%; height: 100%; border: 0; object-fit: contain; background: white; }
#viewer-stage video { background: black; }
#viewer-status { text-align: center; margin: 0; padding: 0 .75rem; }
@media (max-width: 575px) { .viewer-controls { gap: .5rem; padding: .5rem; } .preview-launch span { font-size: .75rem; padding: .3rem; } }
#fullscreen-viewer { display: flex; flex-direction: column; width: 100%; height: 100%; min-height: 0; background: #080e16; color: white; }
.media-card { flex: 1; display: flex; flex-direction: column; } .media-card-footer { margin-top: auto; padding: .75rem 1rem; background: #f8fafc; border-top: 1px solid #dce5eb; white-space: pre-wrap; overflow-wrap: anywhere; }

.media-card-title { margin: 0 0 .75rem; overflow-wrap: anywhere; }
.media-thumbnail { width: 100%; height: 100%; object-fit: cover; }
