.qrmenu-stories-section {
    --story-ring-size: 72px;
    --story-thumb-size: 64px;
}

.qrmenu-stories-head {
    margin-bottom: 0.65rem;
}

.qrmenu-stories-title {
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #111827;
}

body.ui-color-dark .qrmenu-stories-title {
    color: #f3f4f6;
}

.qrmenu-stories-rail-wrap {
    overflow: hidden;
}

.qrmenu-stories-rail {
    display: flex;
    gap: 0.85rem;
    overflow-x: auto;
    padding: 0.35rem 1rem 0.75rem;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.qrmenu-stories-rail::-webkit-scrollbar {
    display: none;
}

.qrmenu-story-chip {
    flex: 0 0 auto;
    width: calc(var(--story-ring-size) + 4px);
    border: none;
    background: transparent;
    padding: 0;
    cursor: pointer;
    text-align: center;
    scroll-snap-align: start;
}

.qrmenu-story-ring {
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--story-ring-size);
    height: var(--story-ring-size);
    border-radius: 9999px;
    padding: 3px;
    background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
    box-sizing: border-box;
    transition: transform 0.15s ease, opacity 0.15s ease;
}

.qrmenu-story-chip.is-seen .qrmenu-story-ring {
    background: #cbd5e1;
}

.qrmenu-stories-section[data-ring-style="theme"] .qrmenu-story-ring {
    background: linear-gradient(45deg, var(--theme-color, #111827), #6366f1);
}

.qrmenu-stories-section[data-ring-style="theme"] .qrmenu-story-chip.is-seen .qrmenu-story-ring {
    background: #94a3b8;
}

.qrmenu-story-chip:active .qrmenu-story-ring {
    transform: scale(0.96);
}

.qrmenu-story-thumb {
    display: block;
    width: var(--story-thumb-size);
    height: var(--story-thumb-size);
    border-radius: 9999px;
    background-size: cover;
    background-position: center;
    background-color: #e5e7eb;
    border: 2px solid #fff;
    box-sizing: border-box;
}

body.ui-color-dark .qrmenu-story-thumb {
    border-color: #0f172a;
}

.qrmenu-story-label {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.68rem;
    line-height: 1.2;
    color: #374151;
    max-width: calc(var(--story-ring-size) + 12px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.ui-color-dark .qrmenu-story-label {
    color: #d1d5db;
}

.ui-theme-luxury .qrmenu-stories-title {
    font-family: var(--luxury-serif, Georgia, serif);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-size: 0.82rem;
}

@media (min-width: 640px) {
    .qrmenu-stories-section {
        --story-ring-size: 78px;
        --story-thumb-size: 70px;
    }
    .qrmenu-stories-rail {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
}

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

.qrmenu-story-viewer {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qrmenu-story-viewer-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
}

.qrmenu-story-viewer-inner {
    position: relative;
    width: min(100vw, 420px);
    height: min(100vh, 820px);
    max-height: 100vh;
    border-radius: 1rem;
    overflow: hidden;
    background: #111;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.45);
}

.qrmenu-story-viewer-progress {
    position: absolute;
    top: 0.65rem;
    left: 0.65rem;
    right: 0.65rem;
    z-index: 3;
    display: flex;
    gap: 4px;
}

.qrmenu-story-progress-seg {
    flex: 1;
    height: 3px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.35);
    overflow: hidden;
}

.qrmenu-story-progress-fill {
    display: block;
    height: 100%;
    width: 0%;
    background: #fff;
    transition: width 0.05s linear;
}

.qrmenu-story-viewer-close {
    position: absolute;
    top: 2rem;
    right: 0.75rem;
    z-index: 4;
    width: 2rem;
    height: 2rem;
    border: none;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    cursor: pointer;
}

.qrmenu-story-viewer-media {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-color: #1f2937;
}

.qrmenu-story-viewer-footer {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 3;
    padding: 1.25rem 1rem 1.5rem;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.75), transparent);
    color: #fff;
}

.qrmenu-story-viewer-label {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.65rem;
}

.qrmenu-story-viewer-cta {
    border: none;
    border-radius: 999px;
    padding: 0.55rem 1rem;
    font-size: 0.82rem;
    font-weight: 600;
    background: #fff;
    color: #111827;
    cursor: pointer;
}

.qrmenu-story-viewer-nav {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 35%;
    z-index: 2;
    border: none;
    background: transparent;
    cursor: pointer;
}

.qrmenu-story-viewer-prev { left: 0; }
.qrmenu-story-viewer-next { right: 0; }
