    /* =========================================
   Stories horizontal scroll
   ========================================= */

.stories-scroll-wrapper {
    position: relative;
}

/* Scroll container */
.stories-scroller {
    position: relative;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-top: 4px;
    padding-bottom: 4px;
}

.stories-scroller::-webkit-scrollbar {
    display: none;
}


/* =========================================
   Edge fade / blur
   ========================================= */

.stories-scroll-fade {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 40px;
    z-index: 10;
    pointer-events: none;
}

.stories-scroll-fade-right {
    right: 0;
    background: linear-gradient(
        to left,
        var(--neo-bg),
        transparent
    );
    backdrop-filter: blur(1px);
    -webkit-backdrop-filter: blur(1px);

    mask-image: linear-gradient(
        to left,
        black 0%,
        rgba(0, 0, 0, 0.7) 35%,
        transparent 100%
    );

    -webkit-mask-image: linear-gradient(
        to left,
        black 0%,
        rgba(0, 0, 0, 0.7) 35%,
        transparent 100%
    );
}

.stories-scroll-fade-left {
    left: 0;
    background: linear-gradient(
        to right,
        var(--neo-bg),
        transparent
    );
    backdrop-filter: blur(1px);
    -webkit-backdrop-filter: blur(1px);

    mask-image: linear-gradient(
        to left,
        black 0%,
        rgba(0, 0, 0, 0.7) 35%,
        transparent 100%
    );

    -webkit-mask-image: linear-gradient(
        to left,
        black 0%,
        rgba(0, 0, 0, 0.7) 35%,
        transparent 100%
    );
}


/* نوار باریک استوری‌ها زیر هدر (مشترک همه صفحات) */
.stories-strip {
    padding-block: .8rem;
}

.story-item {
    width: 4.75rem;
    flex-shrink: 0;
}

.story-title-wrapper {
    position: relative;
    width: 100%;
    height: 32px;
    margin-top: 8px;
    overflow: hidden;
}

.story-title {
    position: relative;
    height: 32px;
    margin: 0;

    overflow: hidden;

    text-align: center;
    font-size: 0.72rem;
    line-height: 16px;
    font-weight: 700;

    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}


/* Fade at the bottom of long titles */
.story-title-wrapper::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;

    height: 12px;

    pointer-events: none;

    background: linear-gradient(
        to bottom,
        transparent,
        var(--neo-bg)
    );
}


/* =========================================
   Make sure every story has same structure
   ========================================= */

.stories-strip .story-ring {
    flex-shrink: 0;
}

.stories-strip button {
    align-items: center;
}


/* Mobile */
@media (max-width: 640px) {
    .stories-scroll-fade {
        width: 40px;
    }
}
.story-ring {
    width: 68px;
    height: 68px;
    padding: 2px;
    border-radius: 9999px;
    background: linear-gradient(
        135deg,
        #feda75,
        #fa7e1e,
        #d62976,
        #962fbf,
        #4f5bd5
    );
    transition: filter .2s ease, opacity .2s ease;
}

.story-avatar{
    height:100%;
    width:100%;
    overflow:hidden;
    border-radius:9999px;
    border:2px solid var(--neo-surface);
    position:relative;
    background:var(--neo-surface-soft);
}

.story-avatar img{
    height:100%;
    width:100%;
    object-fit:cover;
}

.story-play{
    position:absolute;
    inset:0;
    display:flex;
    align-items:center;
    justify-content:center;
    background:rgba(0,0,0,.25);
    color:white;
    font-size:22px;
}
.scrollbar-hide{
    scrollbar-width:none;
}
.scrollbar-hide::-webkit-scrollbar{
    display:none;
}
.story-viewer {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    overflow: hidden !important;
    z-index: 99999 !important;
    overscroll-behavior: none !important;
    touch-action: none;
}

.story-viewer-container {
    position: relative;
    height: 100dvh !important;
    max-height: 100dvh !important;
    overflow: hidden !important;
    overscroll-behavior: contain !important;
    touch-action: manipulation;
}

html.story-open,
body.story-open {
    overflow: hidden !important;
    height: 100% !important;
    overscroll-behavior: none !important;
}

@media (min-width: 768px) {
    .story-viewer-container {
        height: 90dvh !important;
        max-height: 90dvh !important;
    }
}
.story-viewer {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    z-index: 2147483647 !important;
    overflow: hidden !important;
    isolation: isolate;
    overscroll-behavior: none !important;
    touch-action: none;
}

html.story-open,
body.story-open {
    overflow: hidden !important;
    height: 100% !important;
    overscroll-behavior: none !important;
}

body.story-open > * {
    pointer-events: none;
}

body.story-open #storyViewer {
    pointer-events: auto;
}

/* --- Telegram-like story controls: hold-pause, seek flashes, speed pill --- */
#storyGestures {
    cursor: pointer;
}

.story-flash {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 25;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 5rem;
    height: 5rem;
    border-radius: 999px;
    background: rgb(0 0 0 / 0.55);
    color: #fff;
    font-size: 2.4rem;
    translate: -50% -50%;
    opacity: 0;
    pointer-events: none;
}

.story-flash.is-show {
    animation: story-flash-pop 0.55s ease both;
}

.story-flash.is-holding {
    opacity: 1;
    animation: none;
    scale: 0.92;
}

@keyframes story-flash-pop {
    0% {
        opacity: 0;
        scale: 0.6;
    }
    25% {
        opacity: 1;
        scale: 1;
    }
    70% {
        opacity: 1;
        scale: 1;
    }
    100% {
        opacity: 0;
        scale: 1.05;
    }
}

.story-seek {
    position: absolute;
    top: 50%;
    z-index: 25;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.1rem;
    min-width: 4.2rem;
    padding: 0.55rem 0.7rem;
    border-radius: 1rem;
    background: rgb(0 0 0 / 0.55);
    color: #fff;
    translate: 0 -50%;
    opacity: 0;
    pointer-events: none;
}

.story-seek b {
    font-size: 1.25rem;
    font-weight: 900;
    line-height: 1;
}

.story-seek span {
    font-size: 0.68rem;
    opacity: 0.8;
}

.story-seek--right {
    right: 0.9rem;
}

.story-seek--left {
    left: 0.9rem;
}

.story-seek.is-show {
    animation: story-flash-pop 0.6s ease both;
}

.story-speed {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    height: 2rem;
    padding-inline: 0.8rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 900;
    color: #fff;
    background: rgb(255 255 255 / 0.18);
    border: 1px solid rgb(255 255 255 / 0.35);
    backdrop-filter: blur(6px);
    transition: background 0.15s ease, color 0.15s ease;
}

.story-speed.is-fast {
    background: #fff;
    color: #000;
}

@media (prefers-reduced-motion: reduce) {
    .story-flash.is-show,
    .story-seek.is-show {
        animation-duration: 0.01s;
    }
}
.story-description-wrapper.has-more {
    cursor: pointer;
}

.story-description-wrapper.has-more::after {
    content: "بیشتر";
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.65);
    text-align: right;
}

.story-description-wrapper.has-more.is-open::after {
    content: "بستن";
}
