/* Mod platform: mod box, counters, ratings, mentions, notifications, stories */

.mod-icon {
    display: inline-block;
    flex-shrink: 0;
    vertical-align: -2px;
}

.post-meta .meta-mod-downloads {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.mod-detail-counter {
    color: inherit;
    text-decoration: none;
}

.mod-detail-counter:hover {
    color: var(--vr-theme-color);
}

/* Mod box */
.mod-box {
    --mod-bg: #ffffff;
    --mod-bg-soft: var(--vr-gray-50, #f8f9fa);
    --mod-border: var(--vr-gray-200, #e5e7eb);
    --mod-text: var(--vr-gray-800, #1f2937);
    --mod-muted: var(--vr-gray-500, #6b7280);
    margin-top: 1.75rem;
    padding: 1.25rem 1.25rem 1.5rem;
    border: 1px solid var(--mod-border);
    border-top: 3px solid var(--vr-theme-color);
    border-radius: 0.75rem;
    background: var(--mod-bg);
    color: var(--mod-text);
}

[data-bs-theme="dark"] .mod-box {
    --mod-bg: var(--vr-body-secondary-bg, #1e1f22);
    --mod-bg-soft: rgba(255, 255, 255, 0.04);
    --mod-border: rgba(255, 255, 255, 0.1);
    --mod-text: var(--vr-gray-100, #e5e7eb);
    --mod-muted: var(--vr-gray-400, #9ca3af);
}

.mod-box-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.mod-box-title {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    color: inherit;
}

.mod-version-badge {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--vr-theme-color), transparent 88%);
    color: var(--vr-theme-color);
    font-size: 0.8rem;
    font-weight: 700;
    white-space: nowrap;
}

.mod-box-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.25rem;
    padding: 0.75rem 0.9rem;
    margin-bottom: 1rem;
    border-radius: 0.5rem;
    background: var(--mod-bg-soft);
}

.mod-stat {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.9rem;
    color: var(--mod-muted);
}

.mod-stat strong {
    color: var(--mod-text);
    font-size: 1rem;
}

.mod-box-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.9rem 1.25rem;
    margin: 0;
}

.mod-field {
    min-width: 0;
}

.mod-field-wide {
    grid-column: 1 / -1;
}

.mod-field dt {
    margin-bottom: 0.25rem;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--mod-muted);
}

.mod-field dd {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.55;
    overflow-wrap: anywhere;
}

.mod-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.mod-chip {
    padding: 0.1rem 0.5rem;
    border: 1px solid var(--mod-border);
    border-radius: 0.35rem;
    font-size: 0.85rem;
}

.mod-path {
    display: inline-block;
    padding: 0.15rem 0.45rem;
    border-radius: 0.3rem;
    background: var(--mod-bg-soft);
    color: inherit;
    font-size: 0.85rem;
    word-break: break-all;
}

.mod-credits {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    margin: 0 0 0.35rem;
    padding: 0;
    list-style: none;
}

.mod-credits li {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.mod-credit-user {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: inherit;
    font-weight: 600;
    text-decoration: none;
}

.mod-credit-user:hover {
    color: var(--vr-theme-color);
}

.mod-credit-user img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
}

.mod-credit-role {
    font-size: 0.82rem;
    color: var(--mod-muted);
}

.mod-credits-text {
    color: var(--mod-muted);
    font-size: 0.9rem;
}

.mod-changelog {
    margin-top: 1.1rem;
    border-top: 1px solid var(--mod-border);
    padding-top: 0.9rem;
}

.mod-changelog summary {
    cursor: pointer;
    font-weight: 700;
}

.mod-count {
    color: var(--mod-muted);
    font-weight: 400;
}

.mod-changelog-list {
    margin: 0.75rem 0 0;
    padding: 0;
    list-style: none;
}

.mod-changelog-list li {
    padding: 0.6rem 0;
    border-bottom: 1px dashed var(--mod-border);
}

.mod-changelog-list li:last-child {
    border-bottom: 0;
}

.mod-changelog-head {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.25rem;
    font-size: 0.85rem;
    color: var(--mod-muted);
}

.mod-changelog-body {
    font-size: 0.92rem;
}

.mod-download-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1rem;
    margin-top: 1.25rem;
}

.mod-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1.2rem;
    font-weight: 700;
}

.mod-file-ext {
    padding: 0 0.35rem;
    border-radius: 0.25rem;
    background: rgba(255, 255, 255, 0.22);
    font-size: 0.75rem;
}

.mod-download-note {
    font-size: 0.85rem;
    color: var(--mod-muted);
    overflow-wrap: anywhere;
}

/* Ratings */
.post-meta .meta-mod-rating {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.post-meta .meta-mod-rating .mod-icon {
    color: #f5a623;
}

.post-meta .meta-mod-rating.is-empty .mod-icon {
    color: currentColor;
    opacity: 0.55;
}

.mod-stars {
    --mod-rating: 0%;
    display: inline-block;
    font-size: 1rem;
    letter-spacing: 1px;
    line-height: 1;
    background: linear-gradient(90deg, #f5a623 var(--mod-rating), var(--mod-border, #d1d5db) var(--mod-rating));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.mod-rate {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.75rem;
    margin: -0.25rem 0 1rem;
    font-size: 0.9rem;
}

.mod-rate-label {
    font-weight: 600;
}

.mod-rate-stars {
    display: inline-flex;
}

.mod-rate-star {
    padding: 0 2px;
    border: 0;
    background: none;
    color: var(--mod-border);
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    transition: color 0.15s, transform 0.15s;
}

.mod-rate-star.active,
.mod-rate-star.hover {
    color: #f5a623;
}

.mod-rate-stars:hover .mod-rate-star:not(.hover) {
    color: var(--mod-border);
}

.mod-rate-star:hover {
    transform: scale(1.12);
}

.mod-rate-star:focus-visible,
.mod-rate-remove:focus-visible {
    outline: 2px solid var(--vr-theme-color);
    outline-offset: 2px;
    border-radius: 4px;
}

.mod-rate.is-busy {
    opacity: 0.6;
    pointer-events: none;
}

.mod-rate-remove {
    padding: 0;
    border: 0;
    background: none;
    color: var(--mod-muted);
    font-size: 0.82rem;
    text-decoration: underline;
    cursor: pointer;
}

.mod-rate-note,
.mod-rate-status,
.mod-rate-login {
    color: var(--mod-muted);
    font-size: 0.85rem;
}

.mod-rate-login {
    text-decoration: underline;
}

/* Mentions */
.comment-mention {
    color: var(--vr-theme-color);
    font-weight: 600;
    text-decoration: none;
}

.comment-mention:hover {
    text-decoration: underline;
}

.comment-mention.is-unavailable {
    color: inherit;
    font-weight: 400;
    opacity: 0.75;
}

.mention-suggest {
    position: absolute;
    z-index: 1060;
    left: 0.5rem;
    right: 0.5rem;
    top: 100%;
    max-width: 320px;
    margin-top: 4px;
    padding: 4px;
    border: 1px solid var(--vr-gray-200, #e5e7eb);
    border-radius: 0.5rem;
    background: #ffffff;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
}

[data-bs-theme="dark"] .mention-suggest {
    border-color: rgba(255, 255, 255, 0.12);
    background: var(--vr-body-secondary-bg, #1e1f22);
}

.mention-suggest-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.4rem 0.5rem;
    border: 0;
    border-radius: 0.35rem;
    background: none;
    color: inherit;
    text-align: start;
    font-size: 0.9rem;
}

.mention-suggest-item img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
}

.mention-suggest-item.active,
.mention-suggest-item:hover {
    background: color-mix(in srgb, var(--vr-theme-color), transparent 88%);
}

.mention-verified {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #1d9bf0;
    color: #ffffff;
    font-size: 9px;
    font-weight: 700;
}

@media (max-width: 575.98px) {
    .mention-suggest {
        max-width: none;
    }
}

@media (max-width: 575.98px) {
    .mod-box {
        padding: 1rem;
    }

    .mod-box-fields {
        grid-template-columns: 1fr;
    }

    .mod-download-btn {
        width: 100%;
        justify-content: center;
    }
}

/* Notifications */
.notif-bell,
.notif-page,
.notif-dropdown,
.notif-pref-table,
.push-device-card,
.notif-games,
.notif-devices,
.push-landing,
.mobile-nav-wrapper .header-actions {
    --notif-bg: #ffffff;
    --notif-soft: var(--vr-gray-50, #f8f9fa);
    --notif-unread: color-mix(in srgb, var(--vr-theme-color, #2d65fe), transparent 92%);
    --notif-border: var(--vr-gray-200, #e5e7eb);
    --notif-text: var(--vr-gray-800, #1f2937);
    --notif-muted: var(--vr-gray-500, #6b7280);
}

[data-bs-theme="dark"] .notif-bell,
[data-bs-theme="dark"] .notif-page,
[data-bs-theme="dark"] .notif-dropdown,
[data-bs-theme="dark"] .notif-pref-table,
[data-bs-theme="dark"] .push-device-card,
[data-bs-theme="dark"] .notif-games,
[data-bs-theme="dark"] .notif-devices,
[data-bs-theme="dark"] .push-landing,
[data-bs-theme="dark"] .mobile-nav-wrapper .header-actions {
    --notif-bg: var(--vr-body-secondary-bg, #1e1f22);
    --notif-soft: rgba(255, 255, 255, 0.04);
    --notif-unread: color-mix(in srgb, var(--vr-theme-color, #2d65fe), transparent 84%);
    --notif-border: rgba(255, 255, 255, 0.1);
    --notif-text: var(--vr-gray-100, #e5e7eb);
    --notif-muted: var(--vr-gray-400, #9ca3af);
}

.mobile-nav-wrapper .header-actions {
    display: flex;
    align-items: center;
}

.notif-bell-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.notif-bell .dropdown-toggle::after {
    display: none;
}

.notif-badge {
    position: absolute;
    top: -6px;
    right: -8px;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border-radius: 9px;
    background: #e11d48;
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
    line-height: 17px;
    text-align: center;
}

.mobile-nav-wrapper .notif-bell-btn .notif-badge {
    top: 6px;
    right: 4px;
}

.notif-badge[hidden] {
    display: none;
}

.notif-dropdown {
    width: 360px;
    max-width: calc(100vw - 1.5rem);
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--notif-border);
    border-radius: 0.75rem;
    background: var(--notif-bg);
    color: var(--notif-text);
}

.notif-dropdown-head,
.notif-dropdown-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.7rem 1rem;
    font-size: 0.85rem;
}

.notif-dropdown-head {
    border-bottom: 1px solid var(--notif-border);
}

.notif-dropdown-foot {
    border-top: 1px solid var(--notif-border);
}

.notif-dropdown-foot a {
    color: var(--vr-theme-color);
    text-decoration: none;
}

.notif-dropdown-title {
    font-weight: 700;
}

.notif-mark-all {
    padding: 0;
    border: 0;
    background: none;
    color: var(--vr-theme-color);
    font-size: 0.8rem;
}

.notif-mark-all[hidden] {
    display: none;
}

.notif-dropdown-body {
    max-height: 420px;
    overflow-y: auto;
}

.notif-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.notif-page .notif-list {
    border: 1px solid var(--notif-border);
    border-radius: 0.75rem;
    overflow: hidden;
    background: var(--notif-bg);
}

.notif-item + .notif-item {
    border-top: 1px solid var(--notif-border);
}

.notif-item.is-unread {
    background: var(--notif-unread);
}

.notif-link {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.8rem 1rem;
    color: var(--notif-text);
    text-decoration: none;
}

a.notif-link:hover {
    background: var(--notif-soft);
    color: var(--notif-text);
}

.notif-avatar {
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    overflow: hidden;
    background: var(--notif-soft);
    color: var(--vr-theme-color);
}

.notif-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.notif-avatar svg {
    width: 18px;
    height: 18px;
}

.notif-body {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
    flex: 1;
}

.notif-text {
    font-size: 0.875rem;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.notif-time,
.notif-unavailable {
    font-size: 0.75rem;
    color: var(--notif-muted);
}

.notif-item.is-unavailable .notif-text {
    opacity: 0.75;
}

.notif-unavailable {
    font-style: italic;
}

.notif-dot {
    flex: 0 0 8px;
    width: 8px;
    height: 8px;
    margin-top: 0.4rem;
    border-radius: 50%;
    background: var(--vr-theme-color);
}

.notif-empty {
    padding: 1.5rem 1rem;
    text-align: center;
    color: var(--notif-muted, #6b7280);
    font-size: 0.9rem;
}

.notif-page-inner {
    max-width: 760px;
}

.notif-page-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.notif-page-count {
    color: var(--notif-muted);
    font-size: 0.875rem;
}

.notif-page-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.notif-btn {
    border: 1px solid var(--notif-border);
    background: var(--notif-bg);
    color: var(--notif-text);
}

.notif-btn:hover,
.notif-btn:focus-visible {
    border-color: var(--vr-theme-color);
    background: var(--notif-bg);
    color: var(--vr-theme-color);
}

.notif-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.25rem;
}

.notif-page-info {
    color: var(--notif-muted);
    font-size: 0.875rem;
}

.notif-pref-table {
    color: var(--notif-text);
}

.notif-pref-table th {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--notif-muted);
    white-space: nowrap;
}

@media (max-width: 575.98px) {
    .notif-link {
        padding: 0.75rem;
    }

    .notif-page-actions,
    .notif-page-actions form,
    .notif-page-actions .btn {
        width: 100%;
    }
}

/* Stories: strip */
.story-strip-section,
.story-editor {
    --story-bg: #ffffff;
    --story-soft: var(--vr-gray-50, #f5f6f8);
    --story-border: var(--vr-gray-200, #e5e7eb);
    --story-text: var(--vr-gray-800, #1f2937);
    --story-muted: var(--vr-gray-500, #6b7280);
    --story-accent: var(--vr-theme-color, #2d65fe);
}

[data-bs-theme="dark"] .story-strip-section,
[data-bs-theme="dark"] .story-editor {
    --story-bg: var(--vr-body-secondary-bg, #1e1f22);
    --story-soft: rgba(255, 255, 255, 0.05);
    --story-border: rgba(255, 255, 255, 0.12);
    --story-text: var(--vr-gray-100, #e5e7eb);
    --story-muted: var(--vr-gray-400, #9ca3af);
}

.story-strip-section {
    margin: 12px 0 20px;
}

.story-strip {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    padding: 4px 2px 6px;
    scrollbar-width: thin;
    scroll-snap-type: x proximity;
}

.story-strip-item {
    position: relative;
    flex: 0 0 auto;
    width: 76px;
    display: flex;
    flex-direction: column;
    align-items: center;
    scroll-snap-align: start;
}

.story-ring {
    width: 70px;
    height: 70px;
    padding: 3px;
    border: 0;
    border-radius: 50%;
    background: conic-gradient(from 210deg, #f58529, #dd2a7b, #8134af, #515bd4, #f58529);
    cursor: pointer;
    transition: transform .15s ease;
}

.story-ring:hover {
    transform: scale(1.04);
}

.story-ring:focus-visible {
    outline: 2px solid var(--story-accent);
    outline-offset: 2px;
}

.story-ring.is-seen {
    background: var(--story-border);
}

.story-ring.is-empty {
    background: transparent;
    border: 2px dashed var(--story-border);
    padding: 2px;
}

.story-ring img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--story-bg);
    background: var(--story-soft);
    display: block;
}

.story-add {
    position: absolute;
    top: 48px;
    right: 6px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid var(--story-bg);
    background: var(--story-accent);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    line-height: 16px;
    padding: 0;
    cursor: pointer;
}

.story-name {
    margin-top: 6px;
    max-width: 76px;
    font-size: 12px;
    color: var(--story-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Stories: profile avatar ring */
.profile-info .profile-image.has-story {
    padding: 0;
    border: 0;
    background: transparent;
}

.profile-info .profile-image.has-story,
.profile-info .profile-image.has-story-add {
    overflow: visible;
}

.profile-story-ring {
    display: block;
    width: 100%;
    height: 100%;
    padding: 3px;
    border: 0;
    border-radius: 50%;
    background: conic-gradient(from 210deg, #f58529, #dd2a7b, #8134af, #515bd4, #f58529);
    cursor: pointer;
    transition: transform .15s ease;
}

.profile-story-ring:hover {
    transform: scale(1.02);
}

.profile-story-ring:focus-visible {
    outline: 2px solid var(--vr-theme-color, #2d65fe);
    outline-offset: 3px;
}

.profile-story-ring.is-seen {
    background: var(--vr-gray-300, #d1d5db);
}

.profile-info .profile-image .profile-story-ring img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--vr-color-white, #ffffff);
    display: block;
}

.profile-story-add {
    position: absolute;
    right: 4px;
    bottom: 4px;
    z-index: 2;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 3px solid var(--vr-color-white, #ffffff);
    border-radius: 50%;
    background: var(--vr-theme-color, #2d65fe);
    color: #fff;
    font-size: 20px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
}

[data-bs-theme="dark"] .profile-info .profile-image .profile-story-ring img,
[data-bs-theme="dark"] .profile-story-add {
    border-color: var(--vr-body-bg, #16171a);
}

[data-bs-theme="dark"] .profile-story-ring.is-seen {
    background: rgba(255, 255, 255, 0.2);
}

@media (max-width: 768px) {
    .profile-story-add {
        width: 26px;
        height: 26px;
        right: 0;
        bottom: 0;
        font-size: 16px;
    }
}

html.story-open,
html.story-open body {
    overflow: hidden;
}

.story-viewer[hidden],
.story-editor[hidden],
.story-viewer [hidden],
.story-editor [hidden] {
    display: none !important;
}

/* Stories: shared text layers */
.story-text-layer {
    position: absolute;
    transform: translate(-50%, -50%);
    font-weight: 700;
    line-height: 1.2;
    white-space: pre;
    text-shadow: 0 1px 4px rgba(0, 0, 0, .6);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    pointer-events: none;
}

.story-text-layer.has-bg {
    background: rgba(0, 0, 0, .55);
    padding: .1em .35em;
    border-radius: .3em;
    text-shadow: none;
}

/* Stories: viewer */
.story-viewer {
    position: fixed;
    inset: 0;
    z-index: 10600;
    background: rgba(0, 0, 0, .94);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    color: #fff;
}

.sv-stage {
    position: relative;
    height: min(92vh, 860px);
    aspect-ratio: 9 / 16;
    max-width: 100vw;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
}

.sv-stage.is-loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 36px;
    height: 36px;
    margin: -18px 0 0 -18px;
    border: 3px solid rgba(255, 255, 255, .25);
    border-top-color: #fff;
    border-radius: 50%;
    animation: sv-spin .8s linear infinite;
}

@keyframes sv-spin {
    to {
        transform: rotate(360deg);
    }
}

.sv-media,
.sv-overlay {
    position: absolute;
    inset: 0;
}

.sv-overlay {
    pointer-events: none;
}

.sv-media-el {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.sv-message {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    padding: 24px;
    text-align: center;
    color: rgba(255, 255, 255, .85);
}

.sv-tap {
    position: absolute;
    top: 64px;
    bottom: 80px;
    z-index: 2;
    touch-action: pan-y;
}

.sv-tap-prev {
    left: 0;
    width: 32%;
}

.sv-tap-next {
    right: 0;
    width: 68%;
}

.sv-progress {
    position: absolute;
    top: 8px;
    left: 8px;
    right: 8px;
    z-index: 3;
    display: flex;
    gap: 4px;
}

.sv-bar {
    flex: 1;
    height: 3px;
    border-radius: 2px;
    background: rgba(255, 255, 255, .35);
    overflow: hidden;
}

.sv-bar > span {
    display: block;
    height: 100%;
    width: 0;
    background: #fff;
}

.sv-header {
    position: absolute;
    top: 18px;
    left: 10px;
    right: 6px;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 8px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, .5);
}

.sv-author {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fff !important;
    text-decoration: none;
    min-width: 0;
    font-weight: 600;
    font-size: 14px;
}

.sv-author .sv-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sv-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex: 0 0 auto;
}

.sv-badge .verified-badge {
    display: inline-flex;
}

.sv-time {
    font-size: 12px;
    color: rgba(255, 255, 255, .75);
    white-space: nowrap;
}

.sv-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
}

.sv-btn {
    width: 34px;
    height: 34px;
    border: 0;
    background: transparent;
    color: #fff;
    font-size: 16px;
    line-height: 1;
    border-radius: 50%;
    cursor: pointer;
}

.sv-btn:hover,
.sv-btn:focus-visible {
    background: rgba(255, 255, 255, .15);
}

.sv-menu {
    position: absolute;
    top: 56px;
    right: 10px;
    z-index: 5;
    min-width: 180px;
    background: #262626;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .4);
}

.sv-menu-item {
    display: block;
    width: 100%;
    padding: 12px 16px;
    border: 0;
    background: transparent;
    color: #fff;
    text-align: left;
    font-size: 14px;
    cursor: pointer;
}

.sv-menu-item:hover {
    background: rgba(255, 255, 255, .08);
}

.sv-menu-item.is-danger {
    color: #ff6b6b;
}

.sv-caption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 64px;
    z-index: 3;
    padding: 24px 14px 8px;
    background: linear-gradient(transparent, rgba(0, 0, 0, .55));
    font-size: 14px;
    line-height: 1.4;
    white-space: pre-line;
    word-break: break-word;
    pointer-events: none;
}

.sv-music {
    font-size: 12px;
    opacity: .85;
    margin-bottom: 4px;
}

.sv-footer {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 4;
    padding: 12px;
    background: rgba(0, 0, 0, .55);
}

.sv-reply {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.sv-reply-input {
    flex: 1;
    min-width: 0;
    height: 40px;
    padding: 0 16px;
    border: 1px solid rgba(255, 255, 255, .5);
    border-radius: 20px;
    background: transparent;
    color: #fff;
    font-size: 14px;
}

.sv-reply-input::placeholder {
    color: rgba(255, 255, 255, .7);
}

.sv-reply-input:focus {
    outline: none;
    border-color: #fff;
}

.sv-send {
    border: 0;
    background: transparent;
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
}

.sv-like {
    width: 40px;
    height: 40px;
    border: 0;
    background: transparent;
    color: #fff;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
}

.sv-like.is-liked {
    color: #ff3040;
}

.sv-stats,
.sv-login {
    width: 100%;
    min-height: 40px;
    border: 0;
    border-radius: 20px;
    background: rgba(255, 255, 255, .12);
    color: #fff;
    font-size: 13px;
    cursor: pointer;
}

.sv-sheet {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 6;
    max-height: 70%;
    display: flex;
    flex-direction: column;
    background: #1c1c1e;
    border-radius: 14px 14px 0 0;
    box-shadow: 0 -8px 24px rgba(0, 0, 0, .4);
}

.sv-sheet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 10px 10px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, .1);
}

.sv-sheet-body {
    overflow-y: auto;
    padding: 8px 16px 16px;
}

.sv-viewers {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sv-viewer {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    font-size: 14px;
}

.sv-viewer a {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff !important;
    text-decoration: none;
    min-width: 0;
    flex: 1;
}

.sv-viewer img {
    border-radius: 50%;
    object-fit: cover;
}

.sv-viewer-like {
    color: #ff3040;
}

.sv-viewer-time,
.sv-empty {
    color: rgba(255, 255, 255, .6);
    font-size: 12px;
}

.sv-empty {
    padding: 12px 0;
    list-style: none;
}

.sv-more,
.sv-primary {
    width: 100%;
    margin-top: 10px;
    min-height: 38px;
    border: 0;
    border-radius: 8px;
    background: rgba(255, 255, 255, .12);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
}

.sv-primary {
    background: #ff3040;
}

.sv-report-title {
    margin: 4px 0 8px;
    font-size: 14px;
}

.sv-radio {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    font-size: 14px;
    cursor: pointer;
}

.sv-report-note {
    width: 100%;
    margin-top: 8px;
    padding: 8px 10px;
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 8px;
    background: transparent;
    color: #fff;
    resize: vertical;
}

.sv-toast {
    position: absolute;
    left: 50%;
    bottom: 80px;
    z-index: 7;
    transform: translateX(-50%);
    max-width: 90%;
    padding: 8px 14px;
    border-radius: 8px;
    background: rgba(255, 255, 255, .95);
    color: #111;
    font-size: 13px;
    text-align: center;
}

.sv-nav {
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .15);
    color: #fff;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}

.sv-nav:hover {
    background: rgba(255, 255, 255, .3);
}

@media (max-width: 767.98px) {
    .story-viewer {
        background: #000;
    }

    .sv-stage {
        width: 100vw;
        height: 100vh;
        height: 100dvh;
        aspect-ratio: auto;
        border-radius: 0;
    }

    .sv-nav {
        display: none;
    }
}

/* Stories: layers shared by the editor and the viewer (same rules in both, sized from the frame width) */
.story-layer {
    position: absolute;
    box-sizing: border-box;
    width: max-content;
    padding: .12em .32em;
    border-radius: .28em;
    line-height: 1.25;
    font-weight: 700;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
}

.story-layer-text:not(.has-bg) {
    text-shadow: 0 1px 3px rgba(0, 0, 0, .45);
}

.story-layer.slf-modern {
    font-family: "Helvetica Neue", Arial, "Segoe UI", sans-serif;
    font-weight: 800;
    letter-spacing: -.01em;
}

.story-layer.slf-serif {
    font-family: Georgia, "Times New Roman", serif;
    font-weight: 700;
}

.story-layer.slf-mono {
    font-family: "Courier New", ui-monospace, Menlo, Consolas, monospace;
    font-weight: 700;
}

.story-layer.slf-strong {
    font-family: Impact, "Arial Black", "Segoe UI Black", sans-serif;
    font-weight: 900;
}

.story-layer-mention,
a.story-layer-mention {
    padding: .25em .6em;
    border-radius: .5em;
    background: rgba(255, 255, 255, .94);
    color: #111 !important;
    font-weight: 800;
    white-space: nowrap;
    text-decoration: none !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .2);
}

.story-layer-mention.is-dark,
a.story-layer-mention.is-dark {
    background: rgba(0, 0, 0, .72);
    color: #fff !important;
}

a.story-layer.is-link {
    pointer-events: auto;
    cursor: pointer;
}

/* Stories: viewer frame for editor-made stories (exact 9:16 box inside the stage) */
.sv-frame {
    position: absolute;
    overflow: hidden;
    background: #000;
}

.sv-frame.is-legacy {
    inset: 0;
}

.sv-media-el.is-placed {
    position: absolute;
    max-width: none;
    object-fit: fill;
}

.sv-overlay {
    z-index: 3;
}

.sv-play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 5;
    width: 72px;
    height: 72px;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, .55);
    color: #fff;
    font-size: 28px;
    line-height: 1;
    transform: translate(-50%, -50%);
    cursor: pointer;
}

.sv-stage.is-buffering::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 4;
    width: 36px;
    height: 36px;
    margin: -18px 0 0 -18px;
    border: 3px solid rgba(255, 255, 255, .25);
    border-top-color: #fff;
    border-radius: 50%;
    animation: sv-spin .8s linear infinite;
    pointer-events: none;
}

/* Stories: editor (full screen on mobile, centered vertical canvas on desktop) */
.story-editor {
    position: fixed;
    inset: 0;
    z-index: 10600;
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    background: #000;
    color: #fff;
    font-size: 14px;
    overscroll-behavior: contain;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.story-editor button {
    font-family: inherit;
}

.se-top,
.se-bottom {
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
    box-sizing: border-box;
}

.se-top {
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 56px;
    padding: calc(8px + env(safe-area-inset-top)) 10px 8px;
}

.se-hist,
.se-tools {
    display: flex;
    align-items: center;
    gap: 4px;
}

.se-tools {
    margin-left: auto;
}

.se-ibtn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .1);
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
}

.se-ibtn:hover,
.se-ibtn:focus-visible {
    background: rgba(255, 255, 255, .22);
}

.se-ibtn.is-active {
    background: #fff;
    color: #111;
}

.se-ibtn.is-danger {
    color: #ff6b6b;
}

.se-ibtn:disabled {
    opacity: .35;
    cursor: default;
}

.se-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 8px 18px;
    border: 0;
    border-radius: 22px;
    background: rgba(255, 255, 255, .16);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
}

.se-pill.is-primary {
    background: #fff;
    color: #111;
}

.se-pill:disabled {
    opacity: .5;
    cursor: default;
}

.story-editor :focus-visible {
    outline: 2px solid #4da3ff;
    outline-offset: 2px;
}

/* Canvas */
.se-main {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform .15s ease;
}

.se-frame {
    position: relative;
    flex: 0 0 auto;
    overflow: hidden;
    background: #000;
    border-radius: 12px;
    touch-action: none;
}

.se-frame::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 9;
    background: #fff;
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s ease;
}

.se-frame.is-flash::after {
    opacity: .75;
    transition: none;
}

.se-media {
    position: absolute;
    display: none;
    max-width: none !important;
    max-height: none !important;
    object-fit: fill;
    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-user-drag: none;
}

.story-editor[data-mode="edit"][data-kind="image"] .se-img,
.story-editor[data-mode="edit"][data-kind="video"] .se-video,
.story-editor[data-mode="review"][data-rkind="image"] .se-img,
.story-editor[data-mode="review"][data-rkind="video"] .se-video {
    display: block;
}

.se-cam {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: none;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
    background: #000;
}

.se-cam.is-mirrored {
    transform: scaleX(-1);
}

.story-editor[data-mode="camera"] .se-cam {
    display: block;
}

.se-guide {
    position: absolute;
    z-index: 2;
    display: none;
    background: #ffd400;
    pointer-events: none;
}

.se-guide.is-on {
    display: block;
}

.se-guide-v {
    top: 0;
    bottom: 0;
    left: 50%;
    width: 1px;
}

.se-guide-h {
    left: 0;
    right: 0;
    top: 50%;
    height: 1px;
}

.se-layers {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: none;
    pointer-events: none;
}

.story-editor[data-mode="edit"] .se-layers {
    display: block;
}

.se-layers .story-layer {
    pointer-events: auto;
    cursor: move;
}

.se-layers .story-layer.is-editing {
    cursor: text;
    outline: none;
    min-width: 1em;
    user-select: text;
    -webkit-user-select: text;
    caret-color: currentColor;
}

.se-layers .story-layer.is-editing:empty::before {
    content: attr(data-ph);
    opacity: .6;
}

.se-sel {
    position: absolute;
    z-index: 4;
    box-sizing: border-box;
    border: 1.5px dashed rgba(255, 255, 255, .95);
    border-radius: 6px;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, .25);
    pointer-events: none;
}

.se-sel.is-editing {
    border-style: solid;
}

.se-handle {
    position: absolute;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .4);
    pointer-events: auto;
    touch-action: none;
}

.se-handle-rot {
    top: -34px;
    left: 50%;
    margin-left: -11px;
    cursor: grab;
}

.se-handle-rot::after {
    content: "⟳";
    display: block;
    color: #111;
    font-size: 14px;
    line-height: 22px;
    text-align: center;
}

.se-handle-size {
    right: -11px;
    bottom: -11px;
    cursor: nwse-resize;
}

.se-sel.is-editing .se-handle {
    display: none;
}

@media (pointer: coarse) {
    .se-handle {
        display: none;
    }
}

/* Start screen (photo / video picking) */
.se-start {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 24px;
    text-align: center;
    background: radial-gradient(circle at 50% 35%, #2b2b30 0%, #0d0d0f 70%);
}

.story-editor[data-mode="start"] .se-start {
    display: flex;
}

.se-start-icon {
    font-size: 48px;
    line-height: 1;
}

.se-start-btn {
    min-height: 46px;
    padding: 12px 26px;
    border: 0;
    border-radius: 24px;
    background: #fff;
    color: #111;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
}

.se-start-hint {
    max-width: 260px;
    color: rgba(255, 255, 255, .7);
    font-size: 13px;
}

.se-link {
    margin-top: 6px;
    padding: 6px 10px;
    border: 0;
    background: transparent;
    color: #fff;
    font-size: 14px;
    text-decoration: underline;
    cursor: pointer;
}

/* Live camera */
.se-cam-ui {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: none;
    pointer-events: none;
}

.story-editor[data-mode="camera"] .se-cam-ui {
    display: block;
}

.se-cam-ui > * {
    pointer-events: auto;
}

.se-cam-ui.is-loading::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 36px;
    height: 36px;
    margin: -18px 0 0 -18px;
    border: 3px solid rgba(255, 255, 255, .25);
    border-top-color: #fff;
    border-radius: 50%;
    animation: sv-spin .8s linear infinite;
}

.se-cam-timer {
    position: absolute;
    top: 12px;
    left: 50%;
    display: none;
    padding: 4px 12px;
    border-radius: 14px;
    background: rgba(0, 0, 0, .55);
    font-size: 13px;
    font-variant-numeric: tabular-nums;
    transform: translateX(-50%);
}

.story-editor[data-cmode="video"] .se-cam-timer {
    display: block;
}

.story-editor.is-recording .se-cam-timer {
    background: #e0245e;
}

.se-cmodes {
    position: absolute;
    left: 50%;
    bottom: 112px;
    display: flex;
    gap: 6px;
    padding: 4px;
    border-radius: 20px;
    background: rgba(0, 0, 0, .45);
    transform: translateX(-50%);
}

.story-editor.is-recording .se-cmodes {
    visibility: hidden;
}

.se-cmode {
    padding: 6px 14px;
    border: 0;
    border-radius: 16px;
    background: transparent;
    color: rgba(255, 255, 255, .75);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.se-cmode.is-active {
    background: #fff;
    color: #111;
}

.se-shutter {
    position: absolute;
    left: 50%;
    bottom: 24px;
    width: 74px;
    height: 74px;
    padding: 0;
    border: 4px solid #fff;
    border-radius: 50%;
    background: rgba(255, 255, 255, .25);
    transform: translateX(-50%);
    cursor: pointer;
}

.se-shutter::after {
    content: "";
    position: absolute;
    inset: 5px;
    border-radius: 50%;
    background: #fff;
    transition: inset .15s ease, border-radius .15s ease;
}

.story-editor[data-cmode="video"] .se-shutter::after {
    background: #e0245e;
}

.story-editor.is-recording .se-shutter::after {
    inset: 20px;
    border-radius: 6px;
}

.se-shutter:disabled {
    opacity: .4;
    cursor: default;
}

.se-cam-msg {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 24px;
    text-align: center;
    background: rgba(0, 0, 0, .88);
}

.se-cam-msg p {
    margin: 0;
    font-size: 15px;
    line-height: 1.45;
}

.se-cam-msg .se-row {
    justify-content: center;
}

.se-cam-msg small {
    max-width: 280px;
    color: rgba(255, 255, 255, .65);
}

/* Captured photo / video review */
.se-review {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 20px;
    z-index: 6;
    display: none;
    justify-content: center;
    gap: 12px;
}

.story-editor[data-mode="review"] .se-review {
    display: flex;
}

/* Upload progress */
.se-progress {
    position: absolute;
    inset: 0;
    z-index: 8;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: rgba(0, 0, 0, .6);
}

.story-editor.is-busy .se-progress {
    display: flex;
}

.se-progress-bar {
    width: 70%;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, .25);
    overflow: hidden;
}

.se-progress-bar > span {
    display: block;
    width: 0;
    height: 100%;
    background: #fff;
    transition: width .2s linear;
}

.se-progress-text {
    font-size: 14px;
    font-weight: 600;
}

/* Selected layer toolbar */
.se-layerbar {
    position: absolute;
    top: calc(62px + env(safe-area-inset-top));
    left: 50%;
    z-index: 6;
    display: flex;
    gap: 4px;
    padding: 4px;
    border-radius: 24px;
    background: rgba(0, 0, 0, .7);
    transform: translateX(-50%);
}

/* Text style bar (pinned to the visible viewport while the keyboard is open) */
.se-textbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 8;
    display: none;
    flex-direction: column;
    gap: 8px;
    max-width: 560px;
    margin: 0 auto;
    padding: calc(8px + env(safe-area-inset-top)) 10px 10px;
    background: rgba(0, 0, 0, .72);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}

.story-editor.is-texting .se-textbar {
    display: flex;
}

.story-editor.is-texting .se-top,
.story-editor.is-texting .se-bottom,
.story-editor.is-texting .se-layerbar {
    visibility: hidden;
}

.se-textbar-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.se-done {
    margin-left: auto;
}

.se-seg {
    display: flex;
    padding: 2px;
    border-radius: 18px;
    background: rgba(255, 255, 255, .15);
}

.se-seg-btn {
    padding: 6px 12px;
    border: 0;
    border-radius: 16px;
    background: transparent;
    color: #fff;
    font-size: 13px;
    cursor: pointer;
}

.se-seg-btn.is-active {
    background: #fff;
    color: #111;
}

.se-font {
    width: 42px;
    height: 36px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, .4);
    border-radius: 18px;
    background: transparent;
    color: #fff;
    font-size: 15px;
    cursor: pointer;
}

.se-font.slf-classic {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    font-weight: 700;
}

.se-font.slf-modern {
    font-family: "Helvetica Neue", Arial, "Segoe UI", sans-serif;
    font-weight: 800;
}

.se-font.slf-serif {
    font-family: Georgia, "Times New Roman", serif;
}

.se-font.slf-mono {
    font-family: "Courier New", ui-monospace, Menlo, Consolas, monospace;
}

.se-font.slf-strong {
    font-family: Impact, "Arial Black", "Segoe UI Black", sans-serif;
    font-weight: 900;
}

.se-font.is-active {
    background: #fff;
    color: #111;
}

.se-swatch {
    width: 26px;
    height: 26px;
    padding: 0;
    border: 2px solid #fff;
    border-radius: 50%;
    cursor: pointer;
}

.se-swatch.is-active {
    box-shadow: 0 0 0 2px #000, 0 0 0 4px #fff;
}

.se-color-input {
    width: 32px;
    height: 30px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, .4);
    border-radius: 6px;
    background: none;
    cursor: pointer;
}

.se-size-row span {
    font-size: 13px;
}

.se-range {
    flex: 1 1 140px;
    width: 100%;
    accent-color: #fff;
    touch-action: pan-x;
}

/* Bottom area */
.se-bottom {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 6px 10px calc(10px + env(safe-area-inset-bottom));
}

.se-status {
    min-height: 18px;
    font-size: 13px;
    text-align: center;
    color: rgba(255, 255, 255, .8);
}

.se-status.is-error {
    color: #ff8a8a;
}

.se-videobar,
.se-actions,
.se-hist,
.se-edit-tools,
.se-cam-tools {
    display: none;
}

.story-editor[data-mode="edit"] .se-hist,
.story-editor[data-mode="edit"] .se-edit-tools,
.story-editor[data-mode="camera"] .se-cam-tools {
    display: flex;
}

.story-editor[data-mode="edit"][data-kind="video"] .se-videobar {
    display: flex;
    align-items: center;
    gap: 8px;
}

.story-editor[data-mode="edit"] .se-actions {
    display: flex;
    justify-content: space-between;
    gap: 8px;
}

.se-share {
    flex: 1 1 auto;
    max-width: 220px;
    margin-left: auto;
}

.se-tl {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
    height: 40px;
    margin: 0 9px;
    border-radius: 8px;
    background: rgba(255, 255, 255, .12);
    touch-action: none;
    cursor: pointer;
}

.se-tl-range {
    position: absolute;
    top: 0;
    bottom: 0;
    box-sizing: border-box;
    border-top: 3px solid #ffd400;
    border-bottom: 3px solid #ffd400;
    background: rgba(255, 212, 0, .15);
    cursor: grab;
}

.se-tl-head {
    position: absolute;
    top: -3px;
    bottom: -3px;
    width: 2px;
    margin-left: -1px;
    background: #fff;
    pointer-events: none;
}

.se-tl-h {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 18px;
    margin-left: -9px;
    padding: 0;
    border: 0;
    border-radius: 4px;
    background: #ffd400;
    cursor: ew-resize;
    touch-action: none;
}

.se-tl-h::after {
    content: "";
    position: absolute;
    top: 30%;
    bottom: 30%;
    left: 50%;
    width: 2px;
    margin-left: -1px;
    background: rgba(0, 0, 0, .5);
}

.se-tl-h::before {
    content: "";
    position: absolute;
    inset: -6px -8px;
}

.se-tl-label {
    min-width: 92px;
    font-size: 12px;
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.se-tl-label.is-error {
    color: #ff8a8a;
}

.se-tabs {
    display: none;
    justify-content: center;
    gap: 4px;
    touch-action: none;
}

.story-editor[data-mode="start"] .se-tabs,
.story-editor[data-mode="camera"] .se-tabs {
    display: flex;
}

.story-editor.is-recording .se-tabs {
    visibility: hidden;
}

.se-tab {
    padding: 8px 16px;
    border: 0;
    border-radius: 18px;
    background: transparent;
    color: rgba(255, 255, 255, .6);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
}

.se-tab.is-active {
    background: rgba(255, 255, 255, .16);
    color: #fff;
}

/* Bottom sheet */
.se-sheet {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9;
    display: flex;
    flex-direction: column;
    max-height: 62%;
    padding-bottom: env(safe-area-inset-bottom);
    border-radius: 16px 16px 0 0;
    background: #1c1c1e;
    box-shadow: 0 -8px 24px rgba(0, 0, 0, .45);
}

.se-sheet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 10px 10px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, .1);
}

.se-sheet-body {
    overflow-y: auto;
    padding: 12px 16px 16px;
    touch-action: pan-y;
    user-select: text;
    -webkit-user-select: text;
}

.se-panel {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.se-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.se-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.se-field > span {
    font-size: 13px;
    font-weight: 600;
}

.se-field.se-inline {
    flex-direction: row;
    align-items: center;
    gap: 10px;
}

.se-chip {
    padding: 8px 14px;
    border: 0;
    border-radius: 18px;
    background: rgba(255, 255, 255, .12);
    color: #fff;
    font-size: 14px;
    cursor: pointer;
}

.se-chip.is-active {
    background: #fff;
    color: #111;
}

.se-note {
    color: rgba(255, 255, 255, .6);
    font-size: 12px;
    line-height: 1.4;
}

.se-filters {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(68px, 1fr));
    gap: 10px;
}

.se-filter {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #fff;
    font-size: 12px;
    cursor: pointer;
}

.se-filter-thumb {
    display: block;
    width: 56px;
    aspect-ratio: 9 / 16;
    overflow: hidden;
    border-radius: 8px;
    background: linear-gradient(135deg, #f58529, #dd2a7b 50%, #515bd4);
}

.se-filter-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
}

.se-filter.is-active .se-filter-thumb {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.story-editor input[type="text"],
.story-editor input[type="search"],
.story-editor input[type="number"],
.story-editor select,
.story-editor textarea {
    box-sizing: border-box;
    padding: 8px 10px;
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 8px;
    background: rgba(255, 255, 255, .08);
    color: #fff;
    font-size: 16px;
}

.story-editor select option {
    color: #111;
}

.se-caption {
    width: 100%;
    resize: vertical;
}

.se-music-current {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, .08);
}

.se-field > .se-range {
    flex: none;
}

.se-music-current[hidden],
.se-music-panel [hidden] {
    display: none;
}

.se-music-msg:empty {
    display: none;
}

.se-music-msg {
    color: #ff8a80;
}

.se-music-cur-label {
    color: rgba(255, 255, 255, .6);
    font-size: 12px;
}

.se-music-cur-title {
    overflow-wrap: anywhere;
}

.se-clip {
    position: relative;
    height: 64px;
    overflow: hidden;
    border-radius: 10px;
    background: rgba(255, 255, 255, .06);
    cursor: grab;
    touch-action: none;
    user-select: none;
}

.se-clip:active {
    cursor: grabbing;
}

.se-clip.is-fixed {
    cursor: default;
}

.se-clip:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.se-clip-wave {
    display: block;
    width: 100%;
    height: 100%;
}

.se-clip-win {
    position: absolute;
    top: 0;
    bottom: 0;
    box-sizing: border-box;
    border: 2px solid #fff;
    border-radius: 10px;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, .55);
    pointer-events: none;
}

.se-clip-head {
    position: absolute;
    top: 6px;
    bottom: 6px;
    width: 2px;
    margin-left: -1px;
    border-radius: 1px;
    background: #ffd400;
    pointer-events: none;
}

.se-clip-times {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
}

.se-clip-times span {
    color: rgba(255, 255, 255, .6);
}

.se-durs {
    gap: 6px;
}

.se-vsound-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.se-vsound-row {
    align-items: center;
    flex-wrap: nowrap;
    gap: 10px;
}

.se-vsound-row .se-chip {
    flex: none;
    white-space: nowrap;
}

.se-vsound-row .se-range {
    flex: 1 1 auto;
    min-width: 0;
}

.se-durs .se-chip {
    padding: 6px 10px;
    font-size: 13px;
}

.se-chip.is-danger {
    color: #ff8a80;
}

.se-music-list {
    display: flex;
    flex-direction: column;
    max-height: 240px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.se-music-item {
    display: flex;
    align-items: center;
    gap: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.se-music-pick {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: flex-start;
    min-width: 0;
    padding: 10px 4px;
    border: 0;
    background: transparent;
    color: #fff;
    font-size: 14px;
    text-align: left;
    cursor: pointer;
}

.se-music-pick small {
    color: rgba(255, 255, 255, .6);
    font-size: 12px;
}

.se-music-pick span,
.se-music-pick small {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.se-music-item.is-active .se-music-pick span::before {
    content: "✓ ";
}

.se-music-empty {
    padding: 10px 4px;
    color: rgba(255, 255, 255, .6);
    font-size: 13px;
}

.se-check {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 13px;
    line-height: 1.4;
    cursor: pointer;
}

.se-check input {
    flex: none;
    width: 18px;
    height: 18px;
    margin: 1px 0 0;
}

.se-music-pill {
    max-width: 45vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.se-music-pill[hidden] {
    display: none;
}

.se-suggest {
    display: flex;
    flex-direction: column;
}

.se-suggest:empty {
    display: none;
}

.se-suggest button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 4px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #fff;
    font-size: 14px;
    text-align: left;
    cursor: pointer;
}

.se-suggest button:hover,
.se-suggest button:focus-visible {
    background: rgba(255, 255, 255, .08);
}

.se-suggest img {
    border-radius: 50%;
    object-fit: cover;
}

.se-verified {
    color: #3897f0;
    font-weight: 700;
}

.se-file {
    position: fixed;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
    left: -10px;
    top: -10px;
}

@media (min-width: 768px) {
    .story-editor {
        background: rgba(12, 12, 14, .96);
    }

    .se-sheet {
        left: 50%;
        right: auto;
        width: min(480px, 100%);
        transform: translateX(-50%);
    }
}

@media (max-width: 767.98px) {
    .se-top {
        min-height: 52px;
        padding-left: 6px;
        padding-right: 6px;
    }

    .se-ibtn {
        width: 38px;
        height: 38px;
    }

    .se-frame {
        border-radius: 10px;
    }
}

/* Stories: private reply inbox */
.story-reply-message {
    margin: 4px 0;
    color: var(--notif-text);
    white-space: pre-line;
    word-break: break-word;
}

.story-reply-thumb img {
    border-radius: 6px;
    object-fit: cover;
}

.story-reply-sender a {
    color: inherit;
}

/* Push notifications: settings page device card, games, devices, click landing pages */
.push-device-card {
    border: 1px solid var(--notif-border);
    border-radius: 10px;
    background: var(--notif-bg);
    color: var(--notif-text);
    padding: 1rem 1.25rem;
}

.push-device-card-head p {
    font-size: 0.875rem;
    color: var(--notif-muted);
    margin-top: 0.25rem;
}

.push-status-list {
    list-style: none;
    padding: 0;
    margin: 0.75rem 0;
    display: grid;
    gap: 0.35rem;
}

.push-status-list li {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    font-size: 0.875rem;
    padding: 0.45rem 0.65rem;
    border-radius: 6px;
    background: var(--notif-soft);
}

.push-status-list li span {
    color: var(--notif-muted);
}

.push-device-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.push-hint {
    margin-top: 0.75rem;
    font-size: 0.85rem;
    line-height: 1.5;
    padding: 0.6rem 0.75rem;
    border-radius: 6px;
    border-left: 3px solid var(--vr-theme-color, #2d65fe);
    background: var(--notif-soft);
}

.notif-pref-note {
    font-size: 0.78rem;
    color: var(--notif-muted);
    margin-top: 0.15rem;
}

.notif-section-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
    color: var(--notif-text);
}

.notif-games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.5rem;
}

.notif-game-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.65rem;
    border: 1px solid var(--notif-border);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--notif-text);
}

.notif-game-option .form-check-input {
    margin: 0;
}

.notif-device-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.notif-device-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--notif-border);
    color: var(--notif-text);
}

.push-landing {
    max-width: 560px;
    margin: 2rem auto;
    text-align: center;
    color: var(--notif-text);
}

.push-landing-title {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
}

.push-landing-actions {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1.25rem;
}

@media (max-width: 575.98px) {
    .push-status-list li {
        flex-direction: column;
        gap: 0.1rem;
    }
}
