:root.svf-document-open,
body.svf-body-open { overflow: hidden !important; overscroll-behavior: none; }

body.svf-page { margin: 0 !important; background: #0d0d0f !important; }

/* Modown compatibility: its fixed header, rollbar and mobile footer otherwise sit above a full-screen shortcode. */
body.svf-page .header,
body.svf-page .topbar,
body.svf-page .search-wrap,
body.svf-page .language-bar,
body.svf-page .footer,
body.svf-page .rollbar,
body.svf-page .footer-fixed-nav,
body.svf-page .bought-barrage,
body.svf-page .sitetips,
body.svf-page .sitetips-pop-shadow,
body.svf-page .sign,
body.svf-page #wpadminbar { display: none !important; }

body.svf-page > .main { width: auto !important; max-width: none !important; margin: 0 !important; padding: 0 !important; }
body.svf-page.admin-bar { margin-top: 0 !important; }
html:has(body.svf-page),
html.svf-document-open { margin-top: 0 !important; zoom: 1 !important; }

body.svf-page .main > .container { width: auto !important; max-width: none !important; margin: 0 !important; padding: 0 !important; }

.svf-shell,
.svf-shell * { box-sizing: border-box; }

.svf-shell {
    position: fixed;
    z-index: 2147483000;
    inset: 0;
    width: 100vw;
    height: 100dvh;
    margin: auto;
    overflow: hidden;
    color: #fff;
    background: #0d0d0f;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    -webkit-font-smoothing: antialiased;
}

.svf-shell button,
.svf-shell input { font: inherit; }

.svf-shell .screen-reader-text { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.svf-shell button { appearance: none; color: inherit; box-shadow: none; text-transform: none; }

.svf-topbar {
    position: fixed;
    z-index: 8;
    top: 3.2vh;
    left: 1.7vw;
    display: flex;
    align-items: center;
    gap: 20px;
}

.svf-close {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 50%;
    background: rgba(20,20,22,.24);
    color: rgba(255,255,255,.78);
    text-decoration: none;
    backdrop-filter: blur(16px);
    transition: background .2s ease, color .2s ease, transform .2s ease;
}

.svf-close:hover { background: rgba(20,20,22,.46); color: #fff; }
.svf-close:active { transform: scale(.96); }
.svf-close .dashicons { width: 30px; height: 30px; font-size: 30px; }

.svf-search {
    display: flex;
    align-items: center;
    width: min(20vw, 312px);
    height: 44px;
    overflow: hidden;
    border: 2px solid rgba(255,255,255,.38);
    border-radius: 12px;
    background: rgba(20,20,22,.2);
    backdrop-filter: blur(16px);
}

.svf-search input {
    flex: 1;
    min-width: 0;
    height: 100%;
    padding: 0 0 0 16px;
    border: 0;
    outline: 0;
    background: transparent;
    color: #fff;
    font-size: 15px;
}

.svf-search input::placeholder { color: rgba(255,255,255,.55); }
.svf-search button { display: flex; align-items: center; gap: 4px; height: 100%; padding: 0 14px 0 10px; border: 0; background: transparent; color: rgba(255,255,255,.72); cursor: pointer; }
.svf-search button:hover { color: #fff; }
.svf-search .dashicons { width: 18px; height: 18px; font-size: 18px; }

.svf-feed {
    width: 100%;
    height: 100%;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    scroll-snap-type: y mandatory;
    scrollbar-width: none;
}

.svf-feed::-webkit-scrollbar { display: none; }

.svf-card {
    position: relative;
    width: 100%;
    height: 100dvh;
    min-height: 100dvh;
    overflow: hidden;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    background: #171719;
}

.svf-backdrop {
    position: absolute;
    inset: -6%;
    display: block;
    width: 112%;
    height: 112%;
    object-fit: cover;
    object-position: center;
    opacity: .88;
    filter: blur(46px) saturate(.82) brightness(.68);
    transform: scale(1.08);
}

.svf-video {
    position: absolute;
    z-index: 1;
    top: 0;
    left: 50%;
    display: block;
    width: min(44vw, calc(100dvh * .5625));
    height: 100%;
    object-fit: contain;
    transform: translateX(-50%);
    background: #09090a;
    box-shadow: 0 0 34px rgba(0,0,0,.28);
    touch-action: manipulation;
    user-select: none;
}

.svf-like-burst {
    position: absolute;
    z-index: 4;
    width: 92px;
    height: 92px;
    margin: -46px 0 0 -46px;
    color: #fff;
    font-size: 92px;
    line-height: 1;
    pointer-events: none;
    filter: drop-shadow(0 3px 12px rgba(255,44,85,.78));
    animation: svf-like-burst .72s ease-out forwards;
}

@keyframes svf-like-burst {
    0% { opacity: 0; transform: scale(.28) rotate(-16deg); }
    24% { opacity: 1; transform: scale(1.18) rotate(8deg); }
    52% { opacity: 1; transform: scale(.96) rotate(0); }
    100% { opacity: 0; transform: translateY(-34px) scale(1.05); }
}

.svf-shade {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: rgba(6,6,8,.08);
}

.svf-sound {
    position: absolute;
    z-index: 2;
    right: max(2.2vw, env(safe-area-inset-right));
    bottom: calc(5vh + env(safe-area-inset-bottom));
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(20,20,22,.36);
    backdrop-filter: blur(12px);
    cursor: pointer;
}

.svf-sound .dashicons { width: 19px; height: 19px; font-size: 19px; }

.svf-rail {
    position: absolute;
    z-index: 2;
    right: max(1.6vw, env(safe-area-inset-right));
    bottom: calc(17vh + env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 26px;
}

.svf-avatar-wrap { position: relative; width: 50px; height: 50px; }

.svf-avatar {
    display: block;
    position: relative;
    width: 50px;
    height: 50px;
    padding: 0;
    border: 2px solid #fff;
    border-radius: 50%;
    background: #333;
    cursor: pointer;
}

.svf-avatar img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }

.svf-follow-badge {
    position: absolute;
    left: 50%;
    bottom: -10px;
    display: grid;
    place-items: center;
    width: 25px;
    height: 25px;
    padding: 0;
    transform: translateX(-50%);
    border: 0;
    border-radius: 50%;
    background: #ff2c55;
    color: #fff;
    font-size: 21px;
    font-weight: 500;
    line-height: 1;
    cursor: pointer;
}

.svf-follow-badge span { display: block; transform: translateY(-1px); }
.svf-follow-badge.is-followed { background: rgba(45,45,45,.88); font-size: 14px; }
.svf-follow-badge:disabled { opacity: .55; cursor: wait; }

.svf-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    min-width: 58px;
    padding: 0;
    border: 0;
    background: transparent;
    text-shadow: 0 1px 5px rgba(0,0,0,.5);
    cursor: pointer;
}

.svf-action .dashicons {
    width: 34px;
    height: 34px;
    font-size: 34px;
    filter: drop-shadow(0 2px 3px rgba(0,0,0,.32));
    transition: transform .18s ease, color .18s ease;
}

.svf-action strong { color: #fff; font-size: 16px; font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; }
.svf-action:active .dashicons { transform: scale(.84); }
.svf-action.is-active .dashicons { color: #ff2c55; transform: scale(1.08); }

.svf-copy {
    position: absolute;
    z-index: 2;
    right: auto;
    bottom: calc(3.4vh + env(safe-area-inset-bottom));
    left: max(1.1vw, env(safe-area-inset-left));
    max-width: min(31vw, 620px);
    text-align: left;
    text-shadow: 0 1px 4px rgba(0,0,0,.58);
}

.svf-author { display: flex; align-items: center; gap: 8px; margin-bottom: 13px; color: #fff; font-size: 16px; }
.svf-author a { color: #fff; font-size: 20px; font-weight: 700; text-decoration: none; }
.svf-author a:hover { text-decoration: underline; }
.svf-author span { color: rgba(255,255,255,.76); font-size: 15px; }
.svf-copy p { max-width: 620px; margin: 5px 0; color: #fff; font-size: 17px; line-height: 1.5; }
.svf-copy .svf-tags { color: #fff; font-size: 15px; font-weight: 600; }

.svf-arrows {
    position: fixed;
    z-index: 4;
    top: 18vh;
    right: max(2.1vw, env(safe-area-inset-right));
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: none;
    border-radius: 24px;
    background: rgba(20,20,22,.26);
    backdrop-filter: blur(14px);
}

.svf-arrows button { display: grid; place-items: center; width: 48px; height: 48px; padding: 0; border: 0; background: transparent; cursor: pointer; }

.svf-pull {
    position: absolute;
    z-index: 6;
    top: 12px;
    left: 50%;
    padding: 8px 14px;
    transform: translate(-50%, -58px);
    border-radius: 18px;
    background: rgba(0,0,0,.58);
    backdrop-filter: blur(10px);
    font-size: 12px;
    pointer-events: none;
    transition: transform .18s ease;
}

.svf-loading,
.svf-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 24px;
    color: rgba(255,255,255,.72);
    text-align: center;
}

.svf-loading { gap: 6px; }
.svf-loading span { width: 7px; height: 7px; border-radius: 50%; background: #fff; animation: svf-bounce .9s infinite alternate; }
.svf-loading span:nth-child(2) { animation-delay: .15s; }
.svf-loading span:nth-child(3) { animation-delay: .3s; }
@keyframes svf-bounce { to { transform: translateY(-7px); opacity: .45; } }

.svf-sentinel { width: 1px; height: 1px; }

.svf-comments { position: absolute; z-index: 10; inset: 0; display: none; align-items: stretch; justify-content: flex-end; }
.svf-comments.is-open { display: flex; }
.svf-comments-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.38); }

.svf-comments-panel {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    width: min(430px, 100%);
    max-height: 100%;
    overflow: hidden;
    border-radius: 18px 0 0 18px;
    background: #fff;
    color: #171717;
    box-shadow: -14px 0 36px rgba(0,0,0,.25);
    animation: svf-drawer-in .22s ease-out;
}

@keyframes svf-drawer-in { from { transform: translateX(100%); } }

.svf-comments-panel header { position: relative; display: flex; align-items: center; justify-content: center; min-height: 52px; padding: 0 14px; border-bottom: 1px solid #eee; }
.svf-comments-title { font-size: 14px; }
.svf-comments-close { position: absolute; right: 14px; display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 0; background: transparent; color: #333 !important; cursor: pointer; }
.svf-comments-close .dashicons { width: 24px; height: 24px; font-size: 24px; }

.svf-comments-list { flex: 1; min-height: 100px; overflow-y: auto; padding: 8px 18px 18px; }
.svf-comment-item { display: flex; gap: 11px; padding: 13px 0; }
.svf-comment-item > img { flex: 0 0 36px; width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.svf-comment-item strong { color: #8b8b92; font-size: 13px; }
.svf-comment-item p { margin: 4px 0; color: #222; font-size: 15px; line-height: 1.45; }
.svf-comment-item time { color: #aaa; font-size: 11px; }
.svf-comments-loading,
.svf-comments-empty { padding: 44px 12px; color: #929299; text-align: center; }

.svf-comments-panel form { padding: 10px max(14px, env(safe-area-inset-right)) calc(10px + env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left)); border-top: 1px solid #eee; }
.svf-guest-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.svf-guest-fields input,
.svf-comment-entry input { min-width: 0; height: 42px; padding: 0 16px; border: 0; border-radius: 22px; outline: 0; background: #f3f3f5; color: #222; }
.svf-comment-entry { display: flex; gap: 10px; }
.svf-comment-entry input { flex: 1; }
.svf-comment-entry button { display: grid; place-items: center; width: 42px; height: 42px; padding: 0; border: 0; border-radius: 50%; background: #ff2c55; color: #fff; cursor: pointer; }
.svf-comment-entry button svg { width: 21px; height: 21px; fill: currentColor; transform: translateX(1px); }
.svf-comment-entry button:disabled { opacity: .38; }

.svf-toast {
    position: absolute;
    z-index: 20;
    left: 50%;
    bottom: 96px;
    max-width: calc(100% - 40px);
    padding: 10px 16px;
    transform: translate(-50%, 12px);
    border-radius: 20px;
    opacity: 0;
    background: rgba(0,0,0,.74);
    backdrop-filter: blur(10px);
    font-size: 13px;
    white-space: nowrap;
    pointer-events: none;
    transition: opacity .18s ease, transform .18s ease;
}

.svf-toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 760px) {
    .svf-shell { width: 100vw; box-shadow: none; }
    .svf-topbar { display: none; }
    .svf-backdrop { display: none; }
    .svf-video { width: 100%; object-fit: cover; box-shadow: none; }
    .svf-shade { background: linear-gradient(180deg, rgba(0,0,0,.05) 48%, rgba(0,0,0,.82) 100%); }
    .svf-sound { top: max(18px, env(safe-area-inset-top)); right: auto; bottom: auto; left: max(18px, env(safe-area-inset-left)); width: 38px; height: 38px; }
    .svf-rail { right: max(14px, env(safe-area-inset-right)); bottom: calc(116px + env(safe-area-inset-bottom)); gap: 34px; }
    .svf-avatar-wrap, .svf-avatar { width: 54px; height: 54px; }
    .svf-action .dashicons { width: 38px; height: 38px; font-size: 38px; }
    .svf-action strong { font-size: 18px; font-weight: 700; }
    .svf-copy { right: 92px; bottom: calc(22px + env(safe-area-inset-bottom)); left: max(14px, env(safe-area-inset-left)); max-width: none; }
    .svf-author { gap: 7px; margin-bottom: 8px; font-size: 15px; }
    .svf-author a { font-size: 16px; }
    .svf-author span { font-size: 13px; }
    .svf-copy p { max-width: 440px; margin: 4px 0; font-size: 15px; line-height: 1.45; }
    .svf-copy .svf-tags { color: #ffe53b; font-size: 13px; }
    .svf-arrows { display: none; }
    .svf-comments { align-items: flex-end; justify-content: stretch; }
    .svf-comments-panel { width: 100%; max-height: 72%; border-radius: 18px 18px 0 0; box-shadow: 0 -14px 36px rgba(0,0,0,.25); animation-name: svf-drawer-in-mobile; }
    @keyframes svf-drawer-in-mobile { from { transform: translateY(100%); } }
}

@media (max-width: 380px) {
    .svf-rail { right: 9px; gap: 26px; }
    .svf-action .dashicons { width: 34px; height: 34px; font-size: 34px; }
    .svf-action strong { font-size: 16px; }
    .svf-avatar-wrap, .svf-avatar { width: 48px; height: 48px; }
    .svf-copy { right: 78px; }
}

@media (prefers-reduced-motion: reduce) {
    .svf-shell *, .svf-shell *::before, .svf-shell *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
