.tk-stories {
    padding: 1rem 0 0.85rem;
    background: transparent;
}

.tk-stories__shell {
    position: relative;
}

.tk-stories__shell::before,
.tk-stories__shell::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0.35rem;
    width: 1.75rem;
    z-index: 2;
    pointer-events: none;
}

.tk-stories__shell::before {
    left: 0;
    background: linear-gradient(90deg, var(--tk-paper, #f7f8fa), transparent);
}

.tk-stories__shell::after {
    right: 0;
    background: linear-gradient(270deg, var(--tk-paper, #f7f8fa), transparent);
}

.tk-stories__track {
    display: flex;
    align-items: flex-start;
    gap: 0.95rem;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0.2rem 0.25rem 0.5rem;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    overscroll-behavior-x: contain;
    cursor: grab;
    touch-action: pan-x manipulation;
}

.tk-stories__track.is-dragging {
    cursor: grabbing;
    scroll-snap-type: none;
    user-select: none;
}

.tk-stories__track.is-dragging .tk-stories__item {
    pointer-events: none;
}

.tk-stories__track::-webkit-scrollbar {
    display: none;
}

.tk-stories__arrow {
    display: none;
    position: absolute;
    top: 50%;
    z-index: 3;
    transform: translateY(calc(-50% - 0.55rem));
    width: 36px;
    height: 36px;
    border: 1px solid #e4e6ea;
    border-radius: 50%;
    background: #fff;
    color: #14181f;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 16px rgba(20, 24, 31, 0.1);
    cursor: pointer;
    padding: 0;
}

.tk-stories__arrow:hover {
    border-color: #c4a878;
    color: #9a7340;
}

.tk-stories__arrow:disabled {
    opacity: 0.35;
    cursor: default;
    pointer-events: none;
}

.tk-stories__arrow--prev { left: 0.15rem; }
.tk-stories__arrow--next { right: 0.15rem; }

@media (min-width: 992px) {
    .tk-stories__shell {
        padding-inline: 2.75rem;
    }

    .tk-stories__arrow {
        display: inline-flex;
    }

    .tk-stories__arrow--prev {
        left: 0;
    }

    .tk-stories__arrow--next {
        right: 0;
    }

    .tk-stories__track {
        padding-inline: 0.35rem;
    }

    .tk-stories__shell::before,
    .tk-stories__shell::after {
        width: 1.25rem;
    }

    .tk-stories__shell::before {
        left: 2.75rem;
    }

    .tk-stories__shell::after {
        right: 2.75rem;
    }
}

.tk-stories__item {
    flex: 0 0 auto;
    width: 92px;
    border: 0;
    padding: 0;
    background: transparent;
    cursor: pointer;
    text-align: center;
    font: inherit;
    color: var(--tk-ink, #14181f);
    scroll-snap-align: start;
    transition: transform 0.2s var(--tk-ease, ease);
}

.tk-stories__item:hover {
    transform: translateY(-2px);
}

.tk-stories__item:focus-visible {
    outline: none;
}

.tk-stories__item:focus-visible .tk-stories__ring {
    box-shadow: 0 0 0 3px rgba(154, 115, 64, 0.35);
}

.tk-stories__ring {
    display: grid;
    place-items: center;
    width: 84px;
    height: 84px;
    margin: 0 auto 0.45rem;
    border-radius: 50%;
    padding: 2.5px;
    background: var(--tk-story-ring, linear-gradient(140deg, #c4a06a, #8a6230, #d4b07a));
    transition: opacity 0.2s ease, filter 0.2s ease;
}

.tk-stories__item.is-seen .tk-stories__ring {
    background: linear-gradient(145deg, #cfd3da, #b8bdc6);
    opacity: 0.85;
}

.tk-stories__media {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    overflow: hidden;
    background: #eee;
    box-shadow: inset 0 0 0 2.5px #fff;
}

.tk-stories__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.tk-stories__caption {
    display: block;
    font-size: 0.72rem;
    font-weight: 650;
    line-height: 1.25;
    max-width: 92px;
    margin: 0 auto;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--tk-ink-soft, #2a3140);
}

/* Viewer */
.tk-story-viewer[hidden] {
    display: none !important;
}

.tk-story-viewer {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: grid;
    place-items: center;
    padding: 0.75rem;
    touch-action: none;
    overscroll-behavior: none;
}

.tk-story-viewer__frame,
.tk-story-viewer__image,
.tk-story-viewer__nav {
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
}

.tk-story-viewer__backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    background: rgba(10, 12, 16, 0.8);
    backdrop-filter: blur(6px);
    cursor: pointer;
}

.tk-story-viewer__frame {
    position: relative;
    z-index: 1;
    width: min(400px, 100%);
    height: min(720px, calc(100vh - 1.5rem));
    border-radius: 1.25rem;
    overflow: hidden;
    background: #0d0d0d;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}

.tk-story-viewer__image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tk-story-viewer__shade {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0.08) 24%, rgba(0, 0, 0, 0.05) 52%, rgba(0, 0, 0, 0.82) 100%);
    pointer-events: none;
}

.tk-story-viewer__progress {
    position: absolute;
    top: 0.65rem;
    left: 0.7rem;
    right: 0.7rem;
    z-index: 4;
    display: flex;
    gap: 0.22rem;
}

.tk-story-viewer__bar {
    flex: 1;
    height: 2.5px;
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.28);
    overflow: hidden;
}

.tk-story-viewer__bar > span {
    display: block;
    height: 100%;
    width: 0;
    background: #fff;
    border-radius: inherit;
}

.tk-story-viewer__bar.is-done > span {
    width: 100%;
}

.tk-story-viewer__bar.is-active > span {
    animation: tk-story-progress var(--story-duration, 5s) linear forwards;
}

@keyframes tk-story-progress {
    from { width: 0; }
    to { width: 100%; }
}

.tk-story-viewer__top {
    position: absolute;
    top: 1.15rem;
    left: 0.85rem;
    right: 0.75rem;
    z-index: 4;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.tk-story-viewer__identity {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    min-width: 0;
    color: #fff;
}

.tk-story-viewer__identity img {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.85);
    background: #333;
}

.tk-story-viewer__identity strong {
    display: block;
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}

.tk-story-viewer__identity small {
    display: block;
    margin-top: 0.1rem;
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.72);
}

.tk-story-viewer__close {
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.35);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
}

.tk-story-viewer__content {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 3;
    padding: 1.35rem 1.15rem 1.4rem;
    color: #fff;
}

.tk-story-viewer__text {
    margin: 0 0 0.95rem;
    font-size: 0.92rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.92);
    max-width: 28ch;
}

.tk-story-viewer__cta {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    min-height: 42px;
    padding: 0 1.05rem;
    border-radius: 999px;
    background: #fff;
    color: #111;
    font-size: 0.88rem;
    font-weight: 700;
}

.tk-story-viewer__nav {
    position: absolute;
    top: 18%;
    bottom: 18%;
    z-index: 2;
    width: 28%;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.tk-story-viewer__nav--prev { left: 0; }
.tk-story-viewer__nav--next { right: 0; }

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

@media (max-width: 767.98px) {
    .tk-stories__item { width: 82px; }
    .tk-stories__ring { width: 76px; height: 76px; }
    .tk-stories__caption { font-size: 0.68rem; max-width: 82px; }

    /* Alt metin/CTA: tarayıcı çubuğu ve home indicator üstünde kalsın */
    .tk-story-viewer__content {
        bottom: 0;
        padding: 1.2rem 1.1rem calc(4.75rem + env(safe-area-inset-bottom, 0px));
    }

    .tk-story-viewer__text {
        margin-bottom: 0.85rem;
        max-width: 32ch;
    }
}

@media (max-width: 575.98px) {
    .tk-story-viewer { padding: 0; }
    .tk-story-viewer__frame {
        width: 100vw;
        height: 100vh;
        height: 100dvh;
        border-radius: 0;
    }

    .tk-story-viewer__content {
        padding: 1.15rem 1.05rem calc(5.25rem + env(safe-area-inset-bottom, 0px));
    }
}

@media (prefers-reduced-motion: reduce) {
    .tk-stories__item { transition: none; }
    .tk-story-viewer__bar.is-active > span {
        animation: none;
        width: 100%;
    }
}
