/* ========== ЛЕНТА ИСТОРИЙ В ЛЕВОЙ ПАНЕЛИ ========== */
.stories-ribbon {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 12px 16px;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--border, rgba(255,255,255,0.1));
    position: relative;
}

.stories-ribbon::-webkit-scrollbar {
    display: none;
}

.stories-ribbon-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    cursor: pointer;
}

.stories-ribbon-label {
    font-size: 11px;
    color: var(--text-secondary);
    text-align: center;
    max-width: 64px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Кнопка закрытия */
.stories-ribbon-close {
    position: absolute;
    right: 12px;
    top: 12px;
    background: rgba(0,0,0,0.5);
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    z-index: 5;
    transition: background 0.2s;
}
.stories-ribbon-close:hover {
    background: rgba(0,0,0,0.7);
}

/* Анимационная обёртка */
.stories-ribbon-wrapper {
    overflow: hidden;
    transition: max-height 0.3s ease-out, opacity 0.2s ease, margin 0.2s ease;
    max-height: 0;
    opacity: 0;
    margin-bottom: 0;
}
.stories-ribbon-wrapper.visible {
    max-height: 200px;
    opacity: 1;
    margin-bottom: 8px;
}

/* ========== ТРИ МИНИАТЮРЫ В ПОЛЕ ПОИСКА (ЕДИНЫЙ КОНТУР) ========== */
.stories-peek {
    display: flex;
    align-items: center;
    gap: 0;
    filter: drop-shadow(0 0 0 2px var(--primary));
    isolation: isolate;
}
.stories-peek-item {
    cursor: pointer;
    flex-shrink: 0;
    margin-right: -16px;
    position: relative;
    transition: transform 0.1s ease;
}
.stories-peek-item:hover {
    z-index: 10;
    transform: scale(1.05);
}
.stories-peek:has(.stories-peek-item:hover) {
    filter: none;
}
.stories-peek-item:last-child {
    margin-right: 0;
}
.stories-peek-item > div {
    border: none !important;
    box-shadow: none !important;
    background-clip: padding-box;
}