/* ===== Stories rail ===== */
.stories-rail {
    background: #fff;
    border-bottom: 1px solid #eee;
    padding: 10px 0;
}

.stories-rail__track {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 2px 4px;
}

.stories-rail__track::-webkit-scrollbar {
    display: none;
}

.story-bubble {
    flex: 0 0 auto;
    width: 72px;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
}

.story-bubble__ring {
    position: relative;
    display: inline-block;
    width: 64px;
    height: 64px;
    padding: 3px;
    border-radius: 50%;
    background: linear-gradient(45deg, #f9ce34, #ee2a7b, #6228d7);
}

.story-bubble__badge {
    position: absolute;
    bottom: -4px;
    right: -4px;
    z-index: 1;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    color: #fff;
    background: #6228d7;
    border: 2px solid #fff;
    border-radius: 10px;
    padding: 2px 5px;
    white-space: nowrap;
}

.story-bubble.is-seen .story-bubble__ring {
    background: #d8d8d8;
}

.story-bubble__thumb {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-color: #c4161c;
    background-size: cover;
    background-position: center;
    border: 2px solid #fff;
}

.story-bubble.no-image .story-bubble__thumb {
    background-image: linear-gradient(135deg, #c4161c, #6228d7);
}

.story-bubble__label {
    margin-top: 6px;
    font-size: 11px;
    line-height: 1.3;
    color: #333;
    width: 100%;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ===== Story viewer ===== */
.story-viewer {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10000;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, .92);
}

.story-viewer.is-active {
    display: flex;
}

body.story-viewer-open {
    overflow: hidden;
}

.story-viewer__frame {
    position: relative;
    width: 100%;
    height: 100%;
    background: #000;
    overflow: hidden;
}

@media (min-width: 640px) {
    .story-viewer__frame {
        width: 420px;
        height: 90vh;
        max-height: 860px;
        border-radius: 14px;
    }
}

.story-viewer__header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 3;
    padding: 10px 12px;
    background: linear-gradient(to bottom, rgba(0, 0, 0, .55), transparent);
}

.story-viewer__progress {
    display: flex;
    gap: 4px;
}

.story-viewer__progress-segment {
    flex: 1;
    height: 3px;
    border-radius: 2px;
    background: rgba(255, 255, 255, .35);
    overflow: hidden;
}

.story-viewer__progress-segment i {
    display: block;
    width: 0;
    height: 100%;
    background: #fff;
}

.story-viewer__progress-segment.is-complete i {
    width: 100%;
}

.story-viewer__topbar {
    margin-top: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.story-viewer__brand {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
}

.story-viewer__brand img {
    height: 22px;
    border-radius: 4px;
}

.story-viewer__close {
    background: none;
    border: 0;
    color: #fff;
    font-size: 22px;
    line-height: 1;
    padding: 4px 8px;
    cursor: pointer;
}

.story-viewer__stage {
    position: absolute;
    inset: 0;
}

.story-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity .15s ease;
}

.story-slide.is-active {
    opacity: 1;
    visibility: visible;
    z-index: 2;
}

.story-slide__media {
    position: absolute;
    inset: 0;
    background-color: #111;
    background-size: cover;
    background-position: center;
}

.story-slide.no-image .story-slide__media {
    background-image: linear-gradient(135deg, #c4161c, #6228d7);
}

.story-slide__overlay {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 3;
    padding: 60px 16px 22px;
    background: linear-gradient(to top, rgba(0, 0, 0, .9), rgba(0, 0, 0, .35) 60%, transparent);
    color: #fff;
    pointer-events: none;
}

.story-slide__views {
    display: inline-block;
    font-size: 12px;
    background: rgba(255, 255, 255, .15);
    border-radius: 12px;
    padding: 3px 10px;
    margin-bottom: 10px;
}

.story-slide__title {
    font-size: 19px;
    font-weight: 700;
    line-height: 1.35;
    margin: 0 0 8px;
}

.story-slide__intro {
    font-size: 13px;
    line-height: 1.5;
    opacity: .85;
    margin: 0 0 14px;
}

.story-slide__cta {
    display: inline-block;
    pointer-events: auto;
    background: #fff;
    color: #111;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    padding: 9px 20px;
    border-radius: 22px;
}

.story-viewer__nav {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 35%;
    z-index: 1;
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
}

.story-viewer__nav--prev {
    left: 0;
}

.story-viewer__nav--next {
    right: 0;
}