.story-viewer {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: #000;
    display: none;
    flex-direction: column;
}

.story-viewer.active {
    display: flex;
}

.story-viewer-media {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.story-viewer-media img,
.story-viewer-media video {
    max-width: 100%;
    max-height: 100vh;
    object-fit: contain;
}

.story-viewer-header {
    position: absolute;
    top: 16px;
    right: 16px;
    left: 60px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    z-index: 2;
}

.story-viewer-close {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 3;
    background: rgba(255,255,255,0.15);
    border: none;
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
}

.story-viewer-progress {
    position: absolute;
    top: 8px;
    left: 8px;
    right: 8px;
    display: flex;
    gap: 4px;
    z-index: 2;
}

.story-seg {
    position: relative;
    flex: 1;
    height: 3px;
    background: rgba(255,255,255,0.3);
    border-radius: 2px;
    overflow: hidden;
}

.story-seg.done::after,
.story-seg.active::after {
    content: '';
    position: absolute;
    inset: 0;
    background: #fff;
}

.story-seg.active::after {
    inset-inline-end: 100%;
    animation: bn-story-fill var(--story-duration, 5s) linear forwards;
}

@keyframes bn-story-fill {
    from { inset-inline-end: 100%; }
    to { inset-inline-end: 0; }
}

.story-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.6);
    font-size: 2rem;
    padding: 20px;
    cursor: pointer;
    z-index: 2;
}

.story-nav-prev { right: 0; }
.story-nav-next { left: 0; }

.story-add-ring {
    background: linear-gradient(135deg, #f093fb, #f5576c);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.2rem;
}

.story-avatar.story-unviewed,
.story-avatar.story-viewed {
    padding: 2px;
}

.story-avatar.story-unviewed {
    background: linear-gradient(135deg, #c7a56f, #ef4444, #2d9b78);
    box-shadow: 0 10px 22px rgba(185, 155, 114, 0.22);
}

.story-avatar.story-viewed {
    background: var(--bn-border-soft);
    opacity: 0.86;
}

.story-viewer-time {
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.78rem;
    white-space: nowrap;
}

.story-viewer-avatar-link {
    display: inline-flex;
    flex-shrink: 0;
    border-radius: 50%;
    text-decoration: none;
}

.story-viewer-avatar-link:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.85);
    outline-offset: 2px;
}

.story-profile-link {
    margin-inline-start: auto;
    color: #fff;
    font-size: 0.85rem;
}
