*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; background: #000; color: var(--menu-text, #e0e6ed); font-family: 'Segoe UI', system-ui, sans-serif; }
#global-now-playing-dock, .global-player-dock { display: none !important; visibility: hidden !important; opacity: 0 !important; pointer-events: none !important; height: 0 !important; overflow: hidden !important; }
body.global-player-visible { padding-bottom: 0 !important; }
body.shorts-page,
body.shorts-page.theme-dark,
body.shorts-page.theme-dark.theme-dark-day,
body.shorts-page.theme-dark.theme-dark-night,
body.shorts-page.theme-grey,
body.shorts-page.theme-white { filter: none !important; }

/* ── Top bar container (auto-hide) ── */
.shorts-topbar { position: fixed; top: 0; left: 0; right: 0; z-index: 3100001; pointer-events: none; opacity: 1; transition: opacity 200ms ease; }
.shorts-topbar > * { pointer-events: auto; }
.shorts-topbar.topbar-hidden { opacity: 0; pointer-events: none; }
.shorts-topbar.topbar-hidden > * { pointer-events: none; }
/* WiPay button stays visible and clickable even when topbar auto-hides */
.shorts-topbar.topbar-hidden .wipay-btn { opacity: 1; pointer-events: auto; }

/* ── Fixed Home button (next to hamburger) ── */
.shorts-home-btn { position: fixed; left: calc(env(safe-area-inset-left, 0px) + 46px); top: calc(env(safe-area-inset-top, 0px) + 8px); z-index: 3100002; width: 34px; height: 30px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--menu-border, rgba(0,255,255,.7)); background: var(--menu-panel, rgba(5,18,34,.92)); color: var(--menu-text, #d3fcff); border-radius: 7px; box-shadow: var(--menu-shadow, 0 0 12px rgba(0,245,255,.3)); cursor: pointer; text-decoration: none; }
.shorts-reload-btn { position: fixed; left: calc(env(safe-area-inset-left, 0px) + 86px); top: calc(env(safe-area-inset-top, 0px) + 8px); z-index: 3100002; width: 34px; height: 30px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--menu-border, rgba(0,255,255,.7)); background: var(--menu-panel, rgba(5,18,34,.92)); color: var(--menu-text, #d3fcff); border-radius: 7px; box-shadow: var(--menu-shadow, 0 0 12px rgba(0,245,255,.3)); cursor: pointer; padding: 0; transition: background .2s; }
.shorts-reload-btn:hover { background: var(--menu-accent, rgba(0,255,255,.85)); color: #00131a; }
.shorts-reload-btn svg { pointer-events: none; }
.shorts-gmute-btn { position: fixed; left: calc(env(safe-area-inset-left, 0px) + 126px); top: calc(env(safe-area-inset-top, 0px) + 8px); z-index: 3100002; width: 34px; height: 30px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--menu-border, rgba(0,255,255,.7)); background: var(--menu-panel, rgba(5,18,34,.92)); color: var(--menu-text, #d3fcff); border-radius: 7px; box-shadow: var(--menu-shadow, 0 0 12px rgba(0,245,255,.3)); cursor: pointer; padding: 0; transition: background .2s; }
.shorts-gmute-btn:hover { background: var(--menu-accent, rgba(0,255,255,.85)); color: #00131a; }
.shorts-gmute-btn svg { pointer-events: none; }
.shorts-gmute-btn .gm-off { display: none; }
.shorts-gmute-btn.is-muted .gm-on { display: none; }
.shorts-gmute-btn.is-muted .gm-off { display: block; }
body.theme-dark .shorts-reload-btn { border-color: #30363d; background: rgba(22,27,34,0.92); color: #c9d1d9; box-shadow: none; }
body.theme-dark .shorts-reload-btn:hover { background: #58a6ff; color: #0d1117; }
body.theme-grey .shorts-reload-btn { border-color: #3c3c3c; background: #252526; color: #d4d4d4; box-shadow: none; }
body.theme-grey .shorts-reload-btn:hover { background: #007acc; color: #fff; }
body.theme-white .shorts-reload-btn { border: 1px solid rgba(140,170,210,.6); background: linear-gradient(180deg, rgba(255,255,255,.85) 0%, rgba(228,235,245,.55) 50%, rgba(215,225,240,.6) 100%); color: #1a1a1a; box-shadow: 0 1px 3px rgba(0,20,60,.1), inset 0 1px 0 rgba(255,255,255,.9); border-radius: 4px; }
body.theme-white .shorts-reload-btn:hover { background: linear-gradient(180deg, rgba(234,246,255,.9) 0%, rgba(190,220,248,.7) 50%, rgba(175,210,245,.75) 100%); color: #0a0a0a; border-color: rgba(80,130,195,.65); }
body.theme-dark .shorts-gmute-btn { border-color: #30363d; background: rgba(22,27,34,0.92); color: #c9d1d9; box-shadow: none; }
body.theme-dark .shorts-gmute-btn:hover { background: #58a6ff; color: #0d1117; }
body.theme-grey .shorts-gmute-btn { border-color: #3c3c3c; background: #252526; color: #d4d4d4; box-shadow: none; }
body.theme-grey .shorts-gmute-btn:hover { background: #007acc; color: #fff; }
body.theme-white .shorts-gmute-btn { border: 1px solid rgba(140,170,210,.6); background: linear-gradient(180deg, rgba(255,255,255,.85) 0%, rgba(228,235,245,.55) 50%, rgba(215,225,240,.6) 100%); color: #1a1a1a; box-shadow: 0 1px 3px rgba(0,20,60,.1), inset 0 1px 0 rgba(255,255,255,.9); border-radius: 4px; }
body.theme-white .shorts-gmute-btn:hover { background: linear-gradient(180deg, rgba(234,246,255,.9) 0%, rgba(190,220,248,.7) 50%, rgba(175,210,245,.75) 100%); color: #0a0a0a; border-color: rgba(80,130,195,.65); }
.shorts-home-btn:hover { background: var(--menu-accent, rgba(0,255,255,.85)); color: #00131a; }
.shorts-home-btn svg { pointer-events: none; }
body.theme-dark .shorts-home-btn { border-color: #30363d; background: rgba(22,27,34,0.92); color: #c9d1d9; box-shadow: none; }
body.theme-dark .shorts-home-btn:hover { background: #58a6ff; color: #0d1117; }
body.theme-grey .shorts-home-btn { border-color: #3c3c3c; background: #252526; color: #fff; box-shadow: none; }
body.theme-grey .shorts-home-btn:hover { background: #007acc; color: #fff; }
body.theme-white .shorts-home-btn { border: 1px solid rgba(140,170,210,.6); background: linear-gradient(180deg, rgba(255,255,255,.85) 0%, rgba(228,235,245,.55) 50%, rgba(215,225,240,.6) 100%); color: #1a1a1a; box-shadow: 0 1px 3px rgba(0,20,60,.1), inset 0 1px 0 rgba(255,255,255,.9); border-radius: 4px; }
body.theme-white .shorts-home-btn:hover { background: linear-gradient(180deg, rgba(234,246,255,.9) 0%, rgba(190,220,248,.7) 50%, rgba(175,210,245,.75) 100%); color: #0a0a0a; border-color: rgba(80,130,195,.65); }
.shorts-history-btn { position: fixed; left: calc(env(safe-area-inset-left, 0px) + 166px); top: calc(env(safe-area-inset-top, 0px) + 8px); z-index: 3100002; width: 34px; height: 30px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--menu-border, rgba(0,255,255,.7)); background: var(--menu-panel, rgba(5,18,34,.92)); color: var(--menu-text, #d3fcff); border-radius: 7px; box-shadow: var(--menu-shadow, 0 0 12px rgba(0,245,255,.3)); cursor: pointer; padding: 0; transition: background .2s; }
.shorts-history-btn:hover { background: var(--menu-accent, rgba(0,255,255,.85)); color: #00131a; }
.shorts-history-btn svg { pointer-events: none; }
body.theme-dark .shorts-history-btn { border-color: #30363d; background: rgba(22,27,34,0.92); color: #c9d1d9; box-shadow: none; }
body.theme-dark .shorts-history-btn:hover { background: #58a6ff; color: #0d1117; }
body.theme-grey .shorts-history-btn { border-color: #3c3c3c; background: #252526; color: #fff; box-shadow: none; }
body.theme-grey .shorts-history-btn:hover { background: #007acc; color: #fff; }
body.theme-white .shorts-history-btn { border: 1px solid rgba(140,170,210,.6); background: linear-gradient(180deg, rgba(255,255,255,.85) 0%, rgba(228,235,245,.55) 50%, rgba(215,225,240,.6) 100%); color: #1a1a1a; box-shadow: 0 1px 3px rgba(0,20,60,.1), inset 0 1px 0 rgba(255,255,255,.9); border-radius: 4px; }
body.theme-white .shorts-history-btn:hover { background: linear-gradient(180deg, rgba(234,246,255,.9) 0%, rgba(190,220,248,.7) 50%, rgba(175,210,245,.75) 100%); color: #0a0a0a; border-color: rgba(80,130,195,.65); }
.shorts-search-btn { position: fixed; top: calc(env(safe-area-inset-top, 0px) + 8px); z-index: 3100002; width: 34px; height: 30px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--menu-border, rgba(0,255,255,.7)); background: var(--menu-panel, rgba(5,18,34,.92)); color: var(--menu-text, #d3fcff); border-radius: 7px; box-shadow: var(--menu-shadow, 0 0 12px rgba(0,245,255,.3)); cursor: pointer; padding: 0; transition: background .2s; }
.shorts-search-btn { right: calc(env(safe-area-inset-right, 0px) + 8px); }
.shorts-search-btn:hover { background: var(--menu-accent, rgba(0,255,255,.85)); color: #00131a; }
.shorts-search-btn svg { pointer-events: none; }

/* ── WIPAY detect button ── */
.wipay-btn { position: fixed; top: calc(env(safe-area-inset-top, 0px) + 44px); right: calc(env(safe-area-inset-right, 0px) - 2px); z-index: 3100002; width: 56px; height: 56px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border-radius: 50%; border: none; background: none; box-shadow: none; color: var(--menu-accent, #00e5ff); cursor: pointer; padding: 0; transition: color .25s, transform .15s; -webkit-appearance: none; appearance: none; }
.wipay-btn:hover { color: #fff; }
.wipay-btn:active { transform: scale(.93); }
.wipay-btn .wipay-rings { pointer-events: none; }
.wipay-btn .wipay-label { font-size: .48rem; font-weight: 700; letter-spacing: .06em; pointer-events: none; line-height: 1; }
.wipay-btn.wipay-listening { color: #4cff88; animation: wipay-pulse 1s infinite; }
.wipay-btn.wipay-detecting { color: #ffab40; animation: none; }
.wipay-btn.wipay-found { color: #4cff88; animation: none; }
.wipay-btn.wipay-fail { color: #ff5c5c; animation: none; }
@keyframes wipay-pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.08); } }
body.theme-dark .wipay-btn { color: #58a6ff; }
body.theme-dark .wipay-btn:hover { color: #79b8ff; }
body.theme-grey .wipay-btn { color: #00b4d8; background: none; box-shadow: none; }
body.theme-white .wipay-btn { color: #0078a8; }
body.theme-white .wipay-btn:hover { color: #005577; }
body.theme-white .wipay-btn .wipay-label { color: #005577; }
body.theme-dark .shorts-search-btn { border-color: #30363d; background: rgba(22,27,34,0.92); color: #c9d1d9; box-shadow: none; }
body.theme-dark .shorts-search-btn:hover { background: #58a6ff; color: #0d1117; }
body.theme-grey .shorts-search-btn { border-color: #3c3c3c; background: #252526; color: #d4d4d4; box-shadow: none; }
body.theme-grey .shorts-search-btn:hover { background: #007acc; color: #fff; }
body.theme-white .shorts-search-btn { border: 1px solid rgba(140,170,210,.6); background: linear-gradient(180deg, rgba(255,255,255,.85) 0%, rgba(228,235,245,.55) 50%, rgba(215,225,240,.6) 100%); color: #1a1a1a; box-shadow: 0 1px 3px rgba(0,20,60,.1), inset 0 1px 0 rgba(255,255,255,.9); border-radius: 4px; }
body.theme-white .shorts-search-btn:hover { background: linear-gradient(180deg, rgba(234,246,255,.9) 0%, rgba(190,220,248,.7) 50%, rgba(175,210,245,.75) 100%); color: #0a0a0a; border-color: rgba(80,130,195,.65); }

/* ── Viewport container ── */
.shorts-app { display: flex; flex-direction: column; height: 100dvh; width: 100vw; max-width: 100%; position: relative; overflow: hidden; margin: 0 auto; }

/* ── Video stage: takes all available space ── */
.video-stage { flex: 1 1 0; position: relative; overflow: hidden; background: #000; touch-action: none; overscroll-behavior-y: contain; transition: flex-basis .35s cubic-bezier(.4,0,.2,1); z-index: 31; }

.video-track { display: flex; flex-direction: column; position: absolute; inset: 0; width: 100%; height: 100%; transition: transform 0.35s cubic-bezier(.4,0,.2,1); will-change: transform; }
.video-track.no-transition { transition: none; }

.video-slide { flex: 0 0 100%; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; }

.video-slide video { width: 100%; height: 100%; object-fit: contain; background: transparent; border-radius: 0; outline: none; position: relative; z-index: 1; }

/* ── Ambient blur behind video ── */
.slide-ambient { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; pointer-events: none; filter: blur(44px) saturate(1.4) brightness(0.5); transform: scale(1.15); opacity: 0; transition: opacity 0.5s ease; -webkit-mask-image: linear-gradient(to right, transparent, black 15%, black 85%, transparent); mask-image: linear-gradient(to right, transparent, black 15%, black 85%, transparent); }
.slide-ambient.active { opacity: 0.75; }
/* Disable expensive ambient blur on mobile — huge GPU savings */
@media (max-width: 600px) { .slide-ambient { display: none !important; } }

/* ── Nostalgia "W" watermark ── */
.nostalgia-w { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-family: 'Georgia', 'Times New Roman', serif; font-size: 6rem; font-weight: bold; font-style: italic; color: rgba(255,255,255,.08); pointer-events: none; z-index: 3; -webkit-user-select: none; user-select: none; text-shadow: 0 0 40px rgba(255,255,255,.04); letter-spacing: 0.05em; }
/* ── Nostalgia "90'" label (bar & sheet buttons) ── */
.nostalgia-label { font-weight: 800; letter-spacing: -.5px; }
.bar-icon-btn .nostalgia-label { font-size: 13px; }
.cat-btn .nostalgia-label { font-size: 12px; letter-spacing: -.3px; }
/* ── JS-toggled initial-hide elements ── */
.comment-login-gate,
.upload-login-gate,
.upload-form,
.upload-preview,
.up-watermark-warn,
.up-cover-row,
.upload-name-row,
.upload-hashtags-row,
.upload-effects-row,
.up-intensity-row,
.up-timing-row,
.up-visibility-row { display: none; }
#uploadFile { display: none; }

/* ── Watched badge (SVG clock icon, top-right) ── */
.watched-badge { position: absolute; top: 10px; right: 13px; z-index: 15; pointer-events: auto; opacity: .85; line-height: 0; filter: drop-shadow(0 1px 2px rgba(0,0,0,.5)); cursor: pointer; transition: opacity .2s, transform .2s; }
.watched-badge:active { transform: scale(1.25); }
.watched-badge svg { stroke: #fff; stroke-width: 1.8; fill: none; width: 24px; height: 24px; }
.video-slide.is-watched .watched-badge svg { stroke: var(--menu-accent, #00f5ff); }

/* ── Video name overlay (TikTok-style: name + hashtags, expandable) ── */
.video-name { position: absolute; bottom: 40px; left: 12px; right: 84px; font-size: .8rem; color: rgba(255,255,255,.78); text-shadow: 0 1px 4px #000; z-index: 35; pointer-events: auto; line-height: 1.4; transition: bottom .35s cubic-bezier(.4,0,.2,1); }
.video-name.vn-expanded { white-space: normal; word-break: break-word; overflow: visible; text-overflow: unset; background: linear-gradient(0deg, rgba(0,0,0,.55) 0%, rgba(0,0,0,.35) 70%, transparent 100%); border-radius: 8px; padding: 6px 8px; margin-left: -8px; margin-bottom: -6px; }
.vn-text { display: block; color: rgba(255,255,255,.88); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vn-tags { display: block; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vn-tags .vn-tag { color: rgba(0,200,255,.9); font-weight: 600; cursor: pointer; transition: color .15s; }
.vn-tags .vn-tag:hover { color: #fff; }
.vn-tag-edit { display: none; background: none; border: none; color: rgba(255,255,255,.5); font-size: .72rem; padding: 2px 6px; cursor: pointer; text-shadow: 0 1px 4px #000; line-height: 1; }
body.is-knopper .vn-tag-edit { display: inline-block; }
.vn-tag-edit:hover { color: #fff; }
.vn-more { display: none; background: none; border: none; color: rgba(255,255,255,.5); font-size: .75rem; font-weight: 700; padding: 0 0 0 6px; cursor: pointer; vertical-align: baseline; text-shadow: 0 1px 4px #000; }
.vn-more:hover { color: #fff; }

/* ── Hashtag editor overlay (knopper only) ── */
.hashtag-editor-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 900; display: none; }
.hashtag-editor-backdrop.open { display: flex; align-items: center; justify-content: center; }
.hashtag-editor { background: var(--cat-sheet-bg, rgba(12,18,30,.96)); border: 1px solid rgba(0,245,255,.15); border-radius: 14px; padding: 20px; width: 90vw; max-width: 400px; min-width: 260px; min-height: 180px; display: flex; flex-direction: column; gap: 12px; resize: both; overflow: auto; }
.hashtag-editor h3 { font-size: .95rem; color: var(--menu-accent, #00f5ff); margin: 0; }
.hashtag-editor .he-label { font-size: .72rem; color: rgba(255,255,255,.5); text-transform: uppercase; letter-spacing: .06em; margin: 0; }
.hashtag-editor input { width: 100%; padding: 10px 12px; border-radius: 8px; border: 1px solid rgba(0,245,255,.3); background: rgba(255,255,255,.06); color: #e0e6ed; font-size: .88rem; outline: none; box-sizing: border-box; }
.hashtag-editor input:focus { border-color: var(--menu-accent, #00f5ff); }
.hashtag-editor .he-suggestions { display: flex; flex-wrap: wrap; gap: 6px; max-height: 120px; overflow-y: auto; }
.hashtag-editor .he-chip { padding: 4px 10px; border-radius: 12px; border: 1px solid rgba(0,245,255,.25); background: rgba(0,245,255,.08); color: #b8e6ea; font-size: .78rem; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s; }
.hashtag-editor .he-chip:hover { background: rgba(0,245,255,.2); border-color: var(--menu-accent, #00f5ff); }
.hashtag-editor .he-chip.active { background: rgba(0,245,255,.25); border-color: var(--menu-accent, #00f5ff); color: #fff; }
.hashtag-editor .he-actions { display: flex; gap: 8px; justify-content: flex-end; }
.hashtag-editor .he-btn { padding: 7px 18px; border-radius: 8px; border: 1px solid rgba(0,245,255,.3); background: transparent; color: #e0e6ed; font-size: .82rem; cursor: pointer; }
.hashtag-editor .he-btn:hover { background: rgba(0,245,255,.1); }
.hashtag-editor .he-btn.he-save { border-color: var(--menu-accent, #00f5ff); color: var(--menu-accent, #00f5ff); font-weight: 600; }
/* Hashtag editor theme overrides */
body.theme-dark .hashtag-editor { background: rgba(22,27,34,.97); border-color: #30363d; }
body.theme-dark .hashtag-editor h3 { color: #58a6ff; }
body.theme-dark .hashtag-editor .he-video-name { color: #8b949e; }
body.theme-dark .hashtag-editor input { background: #161b22; border-color: #30363d; color: #c9d1d9; }
body.theme-dark .hashtag-editor input:focus { border-color: #58a6ff; }
body.theme-dark .hashtag-editor .he-chip { border-color: #30363d; background: rgba(88,166,255,.08); color: #8b949e; }
body.theme-dark .hashtag-editor .he-chip:hover { background: rgba(88,166,255,.18); border-color: #58a6ff; }
body.theme-dark .hashtag-editor .he-chip.active { background: rgba(88,166,255,.22); border-color: #58a6ff; color: #c9d1d9; }
body.theme-dark .hashtag-editor .he-btn { border-color: #30363d; color: #c9d1d9; }
body.theme-dark .hashtag-editor .he-btn:hover { background: rgba(88,166,255,.1); }
body.theme-dark .hashtag-editor .he-btn.he-save { border-color: #58a6ff; color: #58a6ff; }
body.theme-grey .hashtag-editor { background: #1e1e1e; border-color: #3c3c3c; }
body.theme-grey .hashtag-editor h3 { color: #4fc1ff; }
body.theme-grey .hashtag-editor .he-video-name { color: #969696; }
body.theme-grey .hashtag-editor input { background: #2d2d2d; border-color: #3c3c3c; color: #d4d4d4; }
body.theme-grey .hashtag-editor input:focus { border-color: #007acc; }
body.theme-grey .hashtag-editor .he-chip { border-color: #3c3c3c; background: rgba(0,122,204,.08); color: #969696; }
body.theme-grey .hashtag-editor .he-chip:hover { background: rgba(0,122,204,.18); border-color: #007acc; }
body.theme-grey .hashtag-editor .he-chip.active { background: rgba(0,122,204,.22); border-color: #007acc; color: #d4d4d4; }
body.theme-grey .hashtag-editor .he-btn { border-color: #3c3c3c; color: #d4d4d4; }
body.theme-grey .hashtag-editor .he-btn:hover { background: rgba(0,122,204,.1); }
body.theme-grey .hashtag-editor .he-btn.he-save { border-color: #007acc; color: #4fc1ff; }
body.theme-white .hashtag-editor { background: #f0f4f8; border-color: rgba(140,170,210,.4); }
body.theme-white .hashtag-editor h3 { color: #0065c0; }
body.theme-white .hashtag-editor .he-video-name { color: #666; }
body.theme-white .hashtag-editor input { background: #fff; border-color: rgba(0,0,0,.15); color: #222; }
body.theme-white .hashtag-editor input:focus { border-color: #0065c0; }
body.theme-white .hashtag-editor .he-chip { border-color: rgba(0,0,0,.12); background: rgba(0,101,192,.06); color: #555; }
body.theme-white .hashtag-editor .he-chip:hover { background: rgba(0,101,192,.14); border-color: #0065c0; }
body.theme-white .hashtag-editor .he-chip.active { background: rgba(0,101,192,.18); border-color: #0065c0; color: #222; }
body.theme-white .hashtag-editor .he-btn { border-color: rgba(0,0,0,.15); color: #333; }
body.theme-white .hashtag-editor .he-btn:hover { background: rgba(0,101,192,.08); }
body.theme-white .hashtag-editor .he-btn.he-save { border-color: #0065c0; color: #0065c0; }

/* ── FX edit button (left of search, knopper only) ── */
.shorts-fx-btn { position: fixed; top: calc(env(safe-area-inset-top, 0px) + 8px); right: calc(env(safe-area-inset-right, 0px) + 46px); z-index: 3100002; width: 34px; height: 30px; display: none; align-items: center; justify-content: center; border: 1px solid var(--menu-border, rgba(0,255,255,.7)); background: var(--menu-panel, rgba(5,18,34,.92)); color: var(--menu-text, #d3fcff); border-radius: 7px; box-shadow: var(--menu-shadow, 0 0 12px rgba(0,245,255,.3)); cursor: pointer; padding: 0; transition: background .2s; }
body.is-knopper .shorts-fx-btn { display: inline-flex; }
.shorts-fx-btn:hover { background: var(--menu-accent, rgba(0,255,255,.85)); color: #00131a; }
.shorts-fx-btn svg { pointer-events: none; }
body.theme-dark .shorts-fx-btn { border-color: #30363d; background: rgba(22,27,34,0.92); color: #c9d1d9; box-shadow: none; }
body.theme-dark .shorts-fx-btn:hover { background: #58a6ff; color: #0d1117; }
body.theme-grey .shorts-fx-btn { border-color: #3c3c3c; background: #252526; color: #fff; box-shadow: none; }
body.theme-grey .shorts-fx-btn:hover { background: #007acc; color: #fff; }
body.theme-white .shorts-fx-btn { border: 1px solid rgba(140,170,210,.6); background: linear-gradient(180deg, rgba(255,255,255,.85) 0%, rgba(228,235,245,.55) 50%, rgba(215,225,240,.6) 100%); color: #1a1a1a; box-shadow: 0 1px 3px rgba(0,20,60,.1), inset 0 1px 0 rgba(255,255,255,.9); border-radius: 4px; }
body.theme-white .shorts-fx-btn:hover { background: linear-gradient(180deg, rgba(234,246,255,.9) 0%, rgba(190,220,248,.7) 50%, rgba(175,210,245,.75) 100%); color: #0a0a0a; border-color: rgba(80,130,195,.65); }

/* ── Effects editor overlay (knopper only) ── */
.fx-editor-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 900; display: none; }
.fx-editor-backdrop.open { display: flex; align-items: center; justify-content: center; }
.fx-editor { background: var(--cat-sheet-bg, rgba(12,18,30,.96)); border: 1px solid rgba(0,245,255,.15); border-radius: 14px; padding: 20px; width: 92vw; max-width: 880px; max-height: 80vh; min-width: 300px; min-height: 240px; display: flex; flex-direction: column; gap: 12px; overflow: auto; resize: both; }
.fx-editor h3 { font-size: .95rem; color: var(--menu-accent, #00f5ff); margin: 0; }
.fx-editor .fx-video-name { font-size: .8rem; color: rgba(255,255,255,.6); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fx-rows { display: flex; flex-direction: column; gap: 10px; overflow-y: auto; max-height: 50vh; padding-right: 4px; }
.fx-row { background: rgba(255,255,255,.04); border: 1px solid rgba(0,245,255,.12); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 8px; position: relative; }
.fx-row .fx-rm-btn { position: absolute; top: 6px; right: 8px; background: none; border: none; color: rgba(255,80,80,.7); font-size: .8rem; cursor: pointer; padding: 2px 4px; line-height: 1; }
.fx-row .fx-rm-btn:hover { color: #ff4444; }
.fx-select { width: 100%; padding: 8px 10px; border-radius: 8px; border: 1px solid rgba(0,245,255,.3); background: rgba(255,255,255,.06); color: #e0e6ed; font-size: .85rem; outline: none; appearance: auto; }
.fx-select:focus { border-color: var(--menu-accent, #00f5ff); }
.fx-intensity-row { display: flex; align-items: center; gap: 8px; }
.fx-field-label { font-size: .75rem; color: rgba(255,255,255,.5); min-width: 52px; }
.fx-slider { flex: 1; height: 4px; accent-color: var(--menu-accent, #00f5ff); }
.fx-int-val { font-size: .75rem; color: rgba(255,255,255,.7); min-width: 32px; text-align: right; }
.fx-time-row { display: flex; align-items: center; gap: 6px; }
.fx-time-row label { font-size: .72rem; color: rgba(255,255,255,.5); }
.fx-time-input { width: 60px; padding: 6px 8px; border-radius: 6px; border: 1px solid rgba(0,245,255,.2); background: rgba(255,255,255,.06); color: #e0e6ed; font-size: .82rem; outline: none; text-align: center; }
.fx-time-input:focus { border-color: var(--menu-accent, #00f5ff); }
.fx-add-btn { background: none; border: 1px dashed rgba(0,245,255,.3); color: var(--menu-accent, #00f5ff); border-radius: 8px; padding: 8px; font-size: .82rem; cursor: pointer; transition: background .15s; }
.fx-add-btn:hover { background: rgba(0,245,255,.08); }
.fx-actions { display: flex; gap: 8px; justify-content: flex-end; }
.fx-btn { padding: 7px 18px; border-radius: 8px; border: 1px solid rgba(0,245,255,.3); background: transparent; color: #e0e6ed; font-size: .82rem; cursor: pointer; }
.fx-btn:hover { background: rgba(0,245,255,.1); }
.fx-btn.fx-save { border-color: var(--menu-accent, #00f5ff); color: var(--menu-accent, #00f5ff); font-weight: 600; }
.fx-btn.fx-apply { border-color: var(--menu-accent, #00f5ff); color: var(--menu-accent, #00f5ff); background: rgba(0,245,255,.08); }
/* FX editor theme overrides */
body.theme-dark .fx-editor { background: rgba(22,27,34,.97); border-color: #30363d; }
body.theme-dark .fx-editor h3 { color: #58a6ff; }
body.theme-dark .fx-editor .fx-video-name { color: #8b949e; }
body.theme-dark .fx-row { background: rgba(255,255,255,.03); border-color: #30363d; }
body.theme-dark .fx-select { background: #161b22; border-color: #30363d; color: #c9d1d9; }
body.theme-dark .fx-select:focus { border-color: #58a6ff; }
body.theme-dark .fx-field-label { color: #8b949e; }
body.theme-dark .fx-int-val { color: #c9d1d9; }
body.theme-dark .fx-slider { accent-color: #58a6ff; }
body.theme-dark .fx-time-row label { color: #8b949e; }
body.theme-dark .fx-time-input { background: #161b22; border-color: #30363d; color: #c9d1d9; }
body.theme-dark .fx-time-input:focus { border-color: #58a6ff; }
body.theme-dark .fx-add-btn { border-color: #30363d; color: #58a6ff; }
body.theme-dark .fx-add-btn:hover { background: rgba(88,166,255,.08); }
body.theme-dark .fx-btn { border-color: #30363d; color: #c9d1d9; }
body.theme-dark .fx-btn:hover { background: rgba(88,166,255,.1); }
body.theme-dark .fx-btn.fx-save { border-color: #58a6ff; color: #58a6ff; }
body.theme-dark .fx-btn.fx-apply { border-color: #58a6ff; color: #58a6ff; background: rgba(88,166,255,.08); }
body.theme-grey .fx-editor { background: #1e1e1e; border-color: #3c3c3c; }
body.theme-grey .fx-editor h3 { color: #4fc1ff; }
body.theme-grey .fx-editor .fx-video-name { color: #969696; }
body.theme-grey .fx-row { background: rgba(255,255,255,.03); border-color: #3c3c3c; }
body.theme-grey .fx-select { background: #2d2d2d; border-color: #3c3c3c; color: #d4d4d4; }
body.theme-grey .fx-select:focus { border-color: #007acc; }
body.theme-grey .fx-field-label { color: #969696; }
body.theme-grey .fx-int-val { color: #d4d4d4; }
body.theme-grey .fx-slider { accent-color: #007acc; }
body.theme-grey .fx-time-row label { color: #969696; }
body.theme-grey .fx-time-input { background: #2d2d2d; border-color: #3c3c3c; color: #d4d4d4; }
body.theme-grey .fx-time-input:focus { border-color: #007acc; }
body.theme-grey .fx-add-btn { border-color: #3c3c3c; color: #4fc1ff; }
body.theme-grey .fx-add-btn:hover { background: rgba(0,122,204,.08); }
body.theme-grey .fx-btn { border-color: #3c3c3c; color: #d4d4d4; }
body.theme-grey .fx-btn:hover { background: rgba(0,122,204,.1); }
body.theme-grey .fx-btn.fx-save { border-color: #007acc; color: #4fc1ff; }
body.theme-grey .fx-btn.fx-apply { border-color: #007acc; color: #4fc1ff; background: rgba(0,122,204,.08); }
body.theme-white .fx-editor { background: #f0f4f8; border-color: rgba(140,170,210,.4); }
body.theme-white .fx-editor h3 { color: #0065c0; }
body.theme-white .fx-editor .fx-video-name { color: #666; }
body.theme-white .fx-row { background: rgba(0,0,0,.03); border-color: rgba(0,0,0,.1); }
body.theme-white .fx-row .fx-rm-btn { color: rgba(200,50,50,.7); }
body.theme-white .fx-row .fx-rm-btn:hover { color: #cc2222; }
body.theme-white .fx-select { background: #fff; border-color: rgba(0,0,0,.15); color: #222; }
body.theme-white .fx-select:focus { border-color: #0065c0; }
body.theme-white .fx-field-label { color: #666; }
body.theme-white .fx-int-val { color: #333; }
body.theme-white .fx-slider { accent-color: #0065c0; }
body.theme-white .fx-time-row label { color: #666; }
body.theme-white .fx-time-input { background: #fff; border-color: rgba(0,0,0,.15); color: #222; }
body.theme-white .fx-time-input:focus { border-color: #0065c0; }
body.theme-white .fx-add-btn { border-color: rgba(0,0,0,.15); color: #0065c0; }
body.theme-white .fx-add-btn:hover { background: rgba(0,101,192,.06); }
body.theme-white .fx-btn { border-color: rgba(0,0,0,.15); color: #333; }
body.theme-white .fx-btn:hover { background: rgba(0,101,192,.08); }
body.theme-white .fx-btn.fx-save { border-color: #0065c0; color: #0065c0; }
body.theme-white .fx-btn.fx-apply { border-color: #0065c0; color: #0065c0; background: rgba(0,101,192,.06); }
.hashtag-filter-bar { position: fixed; top: 0; left: 0; right: 0; z-index: 50; display: none; align-items: center; gap: 8px; padding: 8px 14px; background: rgba(0,0,0,.85); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.hashtag-filter-bar.active { display: flex; }
.hashtag-filter-bar .hf-label { font-size: .82rem; color: rgba(0,200,255,.9); font-weight: 600; }
.hashtag-filter-bar .hf-clear { background: none; border: 1px solid rgba(255,255,255,.2); color: #fff; font-size: .75rem; padding: 4px 10px; border-radius: 6px; cursor: pointer; }
.hashtag-filter-bar .hf-clear:hover { background: rgba(255,255,255,.1); }

/* ── Translation overlay (below the seeker, under the video name) ── */
.video-translation { position: absolute; bottom: 24px; left: 12px; right: 84px; font-size: .72rem; color: rgba(180,220,255,.85); text-shadow: 0 1px 4px #000, 0 0 6px rgba(0,0,0,.8); pointer-events: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-style: italic; z-index: 35; transition: opacity .3s, bottom .35s cubic-bezier(.4,0,.2,1); }

/* ── Auto-captions overlay (speech-to-text, TikTok-style) ── */
.video-caption { position: absolute; bottom: 100px; left: 12px; right: 84px; font-size: .82rem; line-height: 1.3; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.9), 0 0 8px rgba(0,0,0,.6); pointer-events: none; z-index: 35; opacity: 0; transition: opacity .2s, bottom .35s cubic-bezier(.4,0,.2,1); word-wrap: break-word; overflow-wrap: break-word; }
.video-caption.visible { opacity: 1; }
.video-caption .cap-text { display: inline; background: rgba(0,0,0,.45); padding: 2px 6px; border-radius: 4px; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.shorts-page .video-caption,
.shorts-page .video-caption .cap-text { color: #fff !important; }

/* ── Pause / Play overlay ── */
.pp-overlay { position: absolute; inset: 0; z-index: 10; display: flex; align-items: center; justify-content: center; pointer-events: none; opacity: 0; transition: opacity .25s ease; }
.pp-overlay.flash { opacity: 1; }
.pp-icon { display: none; filter: drop-shadow(0 2px 6px rgba(0,0,0,.6)); }
.pp-overlay.show-pause .pp-pause { display: block; }
.pp-overlay.show-play .pp-play { display: block; }
/* Tap zone: 140x140 (80px icon + 30px each side), centered, always clickable */
.video-slide .pp-tap-zone { position: absolute; top: 50%; left: 50%; width: 140px; height: 140px; transform: translate(-50%, -50%); z-index: 9; cursor: pointer; pointer-events: auto; background: transparent; border: none; padding: 0; margin: 0; -webkit-tap-highlight-color: transparent; }

/* ── Awaiting-play overlay (tap to start) ── */
.video-slide.awaiting-play::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 80px; height: 80px;
  transform: translate(-50%, -50%);
  z-index: 11;
  pointer-events: none;
  border-radius: 50%;
  background: rgba(0,0,0,.45);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 80 80'%3E%3Ccircle cx='40' cy='40' r='36' fill='none' stroke='%23fff' stroke-width='3'/%3E%3Cpolygon points='32,22 32,58 60,40' fill='%23fff' stroke='%23fff' stroke-width='1.5' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  animation: awaitPlayPulse 2s ease-in-out infinite;
}
@keyframes awaitPlayPulse { 0%, 100% { opacity: .8; } 50% { opacity: 1; } }
/* ── Theme-aware custom seeker ── */
/* ── Mobile bottom seek touch zone ── */
.video-slide .seek-touch-zone {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 100px;
  z-index: 37;
  pointer-events: none;
  background: transparent;
  -webkit-tap-highlight-color: transparent;
  transition: bottom .35s cubic-bezier(.4,0,.2,1), height .35s cubic-bezier(.4,0,.2,1);
}
@media (hover: none), (pointer: coarse) {
  .video-slide .seek-touch-zone { pointer-events: auto; }
}
.video-slide .seek-touch-zone.scrubbing {
  height: 100%;
}

.video-slide .video-seeker {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 36;
  transition: bottom .35s cubic-bezier(.4,0,.2,1);
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  pointer-events: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.video-slide .video-seeker::before {
  display: none;
}
.video-slide .video-seeker > * {
  position: relative;
  z-index: 1;
}
/* Meta row: hidden by default, slides in on tap */
.video-slide .seeker-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 6px 12px;
  background: linear-gradient(0deg, rgba(0,0,0,.55) 0%, transparent 100%);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.video-slide .video-seeker.is-expanded .seeker-meta {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.video-slide .seeker-time {
  display: none;
}
.video-slide .seeker-audio {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 112px;
  justify-content: flex-end;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}
.video-slide .seeker-audio.seeker-audio-visible {
  opacity: 1;
  pointer-events: auto;
}
.video-slide .seeker-mute-btn {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: rgba(237,252,255,.94);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  transition: color .18s ease, transform .18s ease;
}
.video-slide .seeker-mute-btn:hover,
.video-slide .seeker-mute-btn:focus-visible {
  outline: none;
}
.video-slide .seeker-mute-btn:active {
  transform: scale(.97);
}
.video-slide .seeker-mute-btn svg {
  pointer-events: none;
}
.video-slide .seeker-mute-btn .mt-off {
  display: none;
}
.video-slide .seeker-mute-btn.is-muted .mt-on {
  display: none;
}
.video-slide .seeker-mute-btn.is-muted .mt-off {
  display: block;
}
.video-slide .seeker-volume {
  width: 64px;
  accent-color: var(--menu-accent, #00f5ff);
  cursor: pointer;
  background: transparent;
}
.video-slide .seeker-volume::-webkit-slider-runnable-track {
  height: 4px;
}
.video-slide .seeker-volume::-webkit-slider-thumb {
  margin-top: -6px;
}
.video-slide .seeker-volume::-moz-range-track {
  height: 4px;
}
.video-slide .seeker-volume::-moz-range-thumb {
  border: none;
}
.video-slide .seeker-time {
  font-size: .66rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(237, 252, 255, .9);
  text-shadow: 0 1px 4px rgba(0,0,0,.7);
}
.video-slide .seeker-time-current {
  color: var(--menu-accent, #7bf8ff);
}
/* TikTok-style time overlay — bottom center, above seeker */
.time-overlay {
  position: absolute;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  z-index: 37;
  transition: opacity .25s ease, bottom .35s cubic-bezier(.4,0,.2,1);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  letter-spacing: .04em;
  color: rgba(255,255,255,.88);
  text-shadow: 0 1px 6px rgba(0,0,0,.7), 0 0 2px rgba(0,0,0,.5);
  pointer-events: none;
  opacity: 0;
  transition: opacity .25s ease;
  white-space: nowrap;
  -webkit-user-select: none;
  user-select: none;
}
.time-overlay.time-overlay-visible {
  opacity: 1;
}
.time-overlay .time-sep {
  opacity: .5;
  margin: 0 2px;
}
.video-slide .progress-bar {
  position: relative;
  height: 14px;
  z-index: auto;
  border-radius: 0;
  border: none;
  background: transparent;
  overflow: visible;
  pointer-events: auto;
  cursor: pointer;
  transition: none;
  padding: 0;
  margin: 0;
}
.video-slide .progress-bar:hover,
.video-slide .progress-bar.scrubbing {
  transform: none;
}
.video-slide .progress-bar:focus-visible {
  outline: none;
}
.video-slide .progress-bar-buffer,
.video-slide .progress-bar-fill {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: 0%;
  border-radius: 0;
}
.video-slide .progress-bar-buffer {
  background: rgba(255,255,255,.25);
  transition: width .25s ease;
}
.video-slide .progress-bar-fill {
  background: var(--menu-accent-strong, #00c8ff);
  transition: width .18s linear;
}
.video-slide .progress-bar-thumb {
  display: none;
}
.video-slide .video-seeker.is-expanded .progress-bar-fill {
  height: 4px;
  box-shadow: 0 0 6px color-mix(in srgb, var(--menu-accent, #00f5ff) 40%, transparent);
}
.video-slide .video-seeker.is-expanded .progress-bar-buffer {
  height: 4px;
}
.video-slide .video-seeker.is-expanded .progress-bar::after {
  height: 4px;
}
.video-slide .progress-bar.scrubbing .progress-bar-fill {
  transition: none;
}
/* Full-width track background line */
.video-slide .progress-bar::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: rgba(255,255,255,.12);
  border-radius: 0;
  pointer-events: none;
}

.theme-dark .video-slide .video-seeker {
  background: transparent;
  border: none;
  box-shadow: none;
}
.theme-dark .video-slide .video-seeker::before {
  display: none;
}
.theme-dark .video-slide .seeker-time {
  color: #c9d1d9;
  text-shadow: 0 1px 4px rgba(0,0,0,.88);
}
.theme-dark .video-slide .seeker-mute-btn {
  color: #c9d1d9;
}
.theme-dark .video-slide .seeker-time-current {
  color: #79c0ff;
}
.theme-dark .video-slide .progress-bar {
  border: none;
  background: transparent;
}
.theme-dark .video-slide .progress-bar-buffer {
  background: rgba(88,166,255,.22);
}
.theme-dark .video-slide .progress-bar-fill {
  background: #79c0ff;
  box-shadow: 0 0 8px rgba(88,166,255,.32);
}
.theme-dark .video-slide .progress-bar-thumb {
  display: none;
}

.theme-grey .video-slide .video-seeker {
  background: transparent;
  border: none;
  box-shadow: none;
}
.theme-grey .video-slide .video-seeker::before {
  display: none;
}
.theme-grey .video-slide .seeker-time {
  color: #d4d4d4;
  letter-spacing: .04em;
}
.theme-grey .video-slide .seeker-mute-btn {
  color: #d4d4d4;
}
.theme-grey .video-slide .seeker-time-current {
  color: #4fc1ff;
}
.theme-grey .video-slide .progress-bar {
  border-radius: 0;
  border: none;
  background: transparent;
}
.theme-grey .video-slide .progress-bar-buffer {
  background: rgba(0,122,204,.26);
}
.theme-grey .video-slide .progress-bar-fill {
  background: #49b0ff;
  box-shadow: 0 0 8px rgba(0,122,204,.28);
}
.theme-grey .video-slide .progress-bar-thumb {
  display: none;
}

.theme-white .video-slide .video-seeker {
  background: transparent;
  border: none;
  box-shadow: none;
}
.theme-white .video-slide .video-seeker::before {
  display: none;
}
.theme-white .video-slide .seeker-time {
  color: #2d5a84;
  text-shadow: none;
}
.theme-white .video-slide .seeker-mute-btn {
  color: #2d5a84;
}
.theme-white .video-slide .seeker-time-current {
  color: #0065c0;
}
.theme-white .video-slide .progress-bar {
  border: none;
  background: transparent;
  box-shadow: none;
}
.theme-white .video-slide .progress-bar-buffer {
  background: rgba(0,101,192,.22);
}
.theme-white .video-slide .progress-bar-fill {
  background: #0065c0;
  box-shadow: 0 0 8px rgba(0,101,192,.3);
}
.theme-white .video-slide .progress-bar-thumb {
  display: none;
}

@media (max-width: 600px) {
  .video-slide .video-seeker {
    right: 0;
    bottom: 0;
    left: 0;
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  .video-slide .video-seeker::before {
    display: none;
  }
  .video-name {
    right: 76px;
    bottom: 36px;
  }
  .video-translation {
    right: 76px;
    bottom: 22px;
  }
  .video-caption {
    right: 76px;
    bottom: 90px;
    font-size: .78rem;
  }
  .video-slide .seeker-time {
    font-size: .62rem;
  }
  .time-overlay { font-size: 10px; bottom: 16px; }
}
.video-slide video { cursor: default; }
.video-slide video::-webkit-media-controls { display: none !important; }
.video-slide video::-webkit-media-controls-enclosure { display: none !important; }

/* ── Nav arrows (left side, stacked vertically) ── */
.nav-arrow { position: absolute; left: 13px; z-index: 20; width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; background: transparent; border: none; color: #fff; font-size: 1rem; cursor: pointer; -webkit-user-select: none; user-select: none; border-radius: 50%; opacity: .55; transition: opacity .4s ease, background .25s; -webkit-tap-highlight-color: transparent; }
.nav-arrow:hover { opacity: 1; background: rgba(255,255,255,.12); }
.nav-arrow.left  { bottom: calc(50% + 24px); }
.nav-arrow.right { bottom: calc(50% - 16px); }
.nav-arrow.hidden { opacity: 0; pointer-events: none; }
.nav-arrow.arrows-faded { opacity: 0; pointer-events: none; }
.nav-arrow.arrows-faded.hidden { opacity: 0; }

/* ── Bottom bar (icon-only, overlaid so stage never resizes) ── */
.bottom-bar { position: absolute; bottom: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: center; gap: 18px; padding: 8px 12px; background: var(--menu-panel, #061225); border-top: 1px solid var(--menu-border, rgba(0,245,255,.12)); touch-action: pan-x; -webkit-user-select: none; user-select: none; transition: max-height .35s cubic-bezier(.4,0,.2,1), padding .35s cubic-bezier(.4,0,.2,1), opacity .35s ease, border-color .35s ease; max-height: 80px; overflow: hidden; z-index: 32; }
.bottom-bar.bar-hidden { max-height: 0; padding-top: 0; padding-bottom: 0; opacity: 0; pointer-events: none; border-color: transparent; }
/* Lift seeker, touch zone and time overlay above the bottom bar when it's visible */
.shorts-app:has(.bottom-bar:not(.bar-hidden)) .video-slide .video-seeker,
.shorts-app:has(.bottom-bar:not(.bar-hidden)) .video-slide .seek-touch-zone { bottom: 58px; }
.shorts-app:has(.bottom-bar:not(.bar-hidden)) .video-slide .seek-touch-zone { bottom: 48px; height: 24px; }
.shorts-app:has(.bottom-bar:not(.bar-hidden)) .video-slide .time-overlay { bottom: 78px; }
.shorts-app:has(.bottom-bar:not(.bar-hidden)) .video-slide .video-name { bottom: 98px; }
.shorts-app:has(.bottom-bar:not(.bar-hidden)) .video-slide .video-translation { bottom: 82px; }
.shorts-app:has(.bottom-bar:not(.bar-hidden)) .video-slide .video-caption { bottom: 158px; }
/* Hover trigger zone (desktop) — invisible strip at the bottom */
.bar-hover-zone { position: fixed; bottom: 0; left: 0; right: 0; height: 28px; z-index: 29; pointer-events: none; }
@media (hover: hover) { .bar-hover-zone { pointer-events: auto; } }
.bottom-bar .pull-hint { position: absolute; top: -18px; left: 50%; transform: translateX(-50%); width: 32px; height: 4px; border-radius: 2px; background: rgba(255,255,255,.18); pointer-events: none; opacity: 0; transition: opacity .2s; }
.bottom-bar:hover .pull-hint { opacity: 1; }

.bar-icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; border-radius: 50%; border: 1.5px solid transparent; background: transparent; color: var(--menu-text, #e0e6ed); cursor: pointer; transition: background .2s, color .2s, border-color .2s, box-shadow .2s; -webkit-tap-highlight-color: transparent; }
.bar-icon-btn:hover { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.2); }
.bar-icon-btn.active { background: var(--menu-accent, #00f5ff); color: #000; border-color: var(--menu-accent, #00f5ff); box-shadow: 0 0 12px color-mix(in srgb, var(--menu-accent, #00f5ff) 40%, transparent); }
.bar-icon-btn.active:hover { background: color-mix(in srgb, var(--menu-accent, #00f5ff) 85%, white); }
.bar-icon-btn.active svg { stroke: #000; }
.bar-menu-toggle { border-style: dashed; border-color: var(--menu-accent, rgba(0,245,255,.5)); color: var(--menu-accent, #e0e6ed); }

.bar-spacer { flex: 1; }
.bar-counter { font-size: .75rem; color: var(--menu-muted, #5a6a7a); white-space: nowrap; }

/* ── Category bottom sheet ── */
.cat-sheet-backdrop { position: fixed; inset: 0; z-index: 260; background: rgba(0,0,0,.55); opacity: 0; pointer-events: none; transition: opacity .25s; }
.cat-sheet-backdrop.open { opacity: 1; pointer-events: auto; }
.cat-sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 261; background: var(--menu-panel, #0a1628); border-radius: 16px 16px 0 0; padding: 12px 20px 24px; transform: translateY(100%); transition: transform .3s cubic-bezier(.4,0,.2,1); pointer-events: none; max-height: 55dvh; overflow-y: auto; }
.cat-sheet.open { transform: translateY(0); pointer-events: auto; }
.cat-sheet-handle { width: 36px; height: 4px; border-radius: 2px; background: rgba(255,255,255,.18); margin: 0 auto 12px; }
.cat-sheet-title { font-size: .95rem; color: var(--menu-accent, #00f5ff); margin: 0 0 14px; font-weight: 600; }
.cat-sheet-list { display: flex; flex-wrap: wrap; gap: 10px; }

/* Divider + favourites button inside sheet */
.cat-sheet-divider { height: 1px; background: rgba(255,255,255,.08); margin: 14px 0; }
.cat-sheet-fav { display: flex; align-items: center; gap: 8px; width: 100%; padding: 12px 16px; border-radius: 12px; border: 1.5px solid rgba(255,255,255,.1); background: rgba(255,255,255,.04); color: var(--menu-text, #e0e6ed); font-size: .9rem; font-weight: 500; cursor: pointer; transition: background .2s, border-color .2s, box-shadow .2s; }
.cat-sheet-fav:hover { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.2); }
.cat-sheet-fav.fav-active { background: #ffd600; color: #000; font-weight: 600; border-color: #ffd600; box-shadow: 0 0 10px rgba(255,214,0,.4); }

/* Category buttons (inside sheet) */
.cat-btn { display: inline-flex; align-items: center; gap: 5px; padding: 9px 20px; border-radius: 20px; border: 1.5px solid transparent; background: transparent; color: var(--menu-text, #e0e6ed); font-size: .88rem; font-weight: 500; cursor: pointer; white-space: nowrap; transition: background .2s, color .2s, border-color .2s, box-shadow .2s; -webkit-tap-highlight-color: transparent; }
.cat-btn:hover { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.2); }
.cat-btn.active { background: var(--menu-accent, #00f5ff); color: #000; font-weight: 600; border-color: var(--menu-accent, #00f5ff); box-shadow: 0 0 12px color-mix(in srgb, var(--menu-accent, #00f5ff) 40%, transparent), 0 0 4px color-mix(in srgb, var(--menu-accent, #00f5ff) 20%, transparent); }
.cat-btn.active:hover { background: color-mix(in srgb, var(--menu-accent, #00f5ff) 85%, white); }

/* ── Favourites divider + row (always last) ── */
.cat-fav-divider { width: 100%; height: 1px; background: rgba(255,255,255,.08); margin: 10px 0 4px; }
.cat-fav-row { display: flex; flex-wrap: wrap; gap: 10px; width: 100%; }
.cat-btn-fav .cat-fav-icon { vertical-align: -2px; }
.cat-btn-fav.active .cat-fav-icon { color: #000; fill: #000; }
body.theme-dark .cat-btn-fav.active .cat-fav-icon { color: #fff; fill: #fff; }
body.theme-white .cat-btn-fav.active .cat-fav-icon { color: #fff; fill: #fff; }

/* ── My Uploads button styling in cat-fav-row ── */
.cat-btn-myuploads { flex: 1; }
.cat-btn-myuploads svg { vertical-align: -2px; }
.cat-btn-myuploads.active svg { color: #000; stroke: #000; }
body.theme-dark .cat-btn-myuploads.active svg { color: #fff; stroke: #fff; }
body.theme-white .cat-btn-myuploads.active svg { color: #0065c0; stroke: #0065c0; }

/* ── Grey theme: category buttons (inverted: inactive=black text, active=white text) ── */
body.theme-grey .cat-btn { border-color: #999; background: #bfbfbf; color: #1a1a1a; }
body.theme-grey .cat-btn:hover { background: #d0d0d0; border-color: #777; color: #111; }
body.theme-grey .cat-btn.active { background: #333; color: #fff; border-color: #555; font-weight: 600; box-shadow: 0 0 10px rgba(255,255,255,.15); }
body.theme-grey .cat-btn.active:hover { background: #444; border-color: #666; }
body.theme-grey .cat-fav-divider { background: rgba(255,255,255,.06); }
/* My Uploads exception: keep VS Code grey look */
body.theme-grey .cat-btn-myuploads { border-color: #3c3c3c; background: #2d2d2d; color: #cccccc; }
body.theme-grey .cat-btn-myuploads:hover { background: #3c3c3c; border-color: #505050; color: #e0e0e0; }
body.theme-grey .cat-btn-myuploads.active { background: #007acc; color: #fff; border-color: #007acc; box-shadow: 0 0 10px rgba(0,122,204,.5), 0 0 3px rgba(0,122,204,.3); }
body.theme-grey .cat-btn-myuploads.active:hover { background: #1a8ad4; border-color: #1a8ad4; }

/* ── White theme: category buttons — light blue tint when off, solid blue when on ── */
body.theme-white .cat-btn { border: 1.5px solid transparent; background: transparent; color: #000; }
body.theme-white .cat-btn:hover { background: rgba(0,80,180,.08); border-color: rgba(0,80,180,.15); color: #333; }
body.theme-white .cat-btn.active { background: #0065c0; color: #fff; border-color: #0065c0; font-weight: 600; box-shadow: 0 2px 10px rgba(0,101,192,.25); }
body.theme-white .cat-btn.active:hover { background: #0078d4; border-color: #0078d4; }
/* Favourites button: red when active */
body.theme-white .cat-btn-fav.active { background: #d32f2f; color: #fff; border-color: #d32f2f; box-shadow: 0 2px 10px rgba(211,47,47,.4); }
body.theme-white .cat-btn-fav.active:hover { background: #e04040; border-color: #e04040; }
body.theme-white .cat-fav-divider { background: rgba(0,0,0,.08); }

/* ── White theme: bar icon buttons ── */
body.theme-white .bar-icon-btn { border-color: transparent; background: transparent; color: #000; }
body.theme-white .bar-icon-btn:hover { background: rgba(0,80,180,.08); border-color: rgba(0,80,180,.15); color: #333; }
body.theme-white .bar-icon-btn.active { background: #0065c0; color: #fff; border-color: #0065c0; box-shadow: 0 2px 10px rgba(0,101,192,.25); }
body.theme-white .bar-icon-btn.active:hover { background: #0078d4; border-color: #0078d4; }
body.theme-white .bar-icon-btn.active svg { stroke: #fff; }
body.theme-white .bottom-bar { background: #e0eaf4; border-top-color: #b8d4f0; }

/* ── Grey / White theme: cat-sheet background ── */
body.theme-grey .cat-sheet { background: #1e1e1e; }
body.theme-grey .cat-sheet-title { color: #007acc; }
body.theme-grey .cat-sheet-handle { background: rgba(255,255,255,.12); }
body.theme-white .cat-sheet { background: #e0eaf4; }
body.theme-white .cat-sheet-title { color: #0066b8; }
body.theme-white .cat-sheet-handle { background: rgba(0,0,0,.12); }

/* ── Loading / empty state ── */
.stage-overlay { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; z-index: 10; pointer-events: none; }
.stage-overlay.hidden { display: none; }
.spinner { width: 40px; height: 40px; border: 3px solid rgba(255,255,255,.15); border-top-color: var(--menu-accent, #00f5ff); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty-msg { color: var(--menu-muted, #5a6a7a); font-size: 1rem; margin-top: 12px; text-align: center; padding: 0 20px; }

/* ── History panel ── */
.history-panel { position: fixed; inset: 0; z-index: 200; background: rgba(0,0,0,.7); display: flex; align-items: flex-end; justify-content: center; opacity: 0; pointer-events: none; transition: opacity .25s; }
.history-panel.open { opacity: 1; pointer-events: auto; }
.history-sheet { width: 100%; max-width: 520px; max-height: 75dvh; background: var(--menu-panel, #061225); border-radius: 16px 16px 0 0; padding: 16px; overflow-y: auto; transform: translateY(100%); transition: transform .3s cubic-bezier(.4,0,.2,1); }
.history-panel.open .history-sheet { transform: translateY(0); }
.history-sheet h3 { margin-bottom: 10px; font-size: 1rem; color: var(--menu-accent, #00f5ff); }
#historyList { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.history-item { display: flex; flex-direction: column; cursor: pointer; border-radius: 8px; overflow: hidden; background: rgba(255,255,255,.04); transition: background .15s; }
.history-item:hover { background: rgba(255,255,255,.1); }
.history-item:active { background: rgba(255,255,255,.16); }
.history-thumb { position: relative; width: 100%; aspect-ratio: 1/1; background: rgba(0,0,0,.3); overflow: hidden; border-radius: 8px 8px 0 0; }
.history-thumb video, .history-thumb img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.history-thumb-empty { background: linear-gradient(135deg, rgba(255,255,255,.06) 0%, rgba(0,200,255,.08) 100%); display: flex; align-items: center; justify-content: center; }
.history-thumb-empty::after { content: '\25B6'; font-size: 1.4rem; color: rgba(255,255,255,.15); }
.history-label { padding: 4px 5px 1px; font-size: .68rem; color: var(--menu-text, #e0e6ed); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.2; }
.history-time { padding: 0 5px 4px; font-size: .6rem; color: var(--menu-muted, #5a6a7a); line-height: 1.2; }
.history-empty { color: var(--menu-muted, #5a6a7a); font-size: .85rem; grid-column: 1 / -1; text-align: center; padding: 20px 0; }
.history-clear { margin-top: 10px; padding: 6px 16px; border-radius: 16px; border: 1px solid var(--menu-muted, #5a6a7a); background: transparent; color: var(--menu-muted, #5a6a7a); font-size: .8rem; cursor: pointer; }
.history-clear:hover { background: rgba(255,255,255,.06); }

/* Search panel */
.shorts-search-panel { position: fixed; inset: 0; z-index: 320; background: rgba(0,0,0,.18); opacity: 0; pointer-events: none; transition: opacity .15s ease; }
.shorts-search-panel.open { opacity: 1; pointer-events: auto; }
.shorts-search-window { position: absolute; top: calc(env(safe-area-inset-top, 0px) + 48px); right: calc(env(safe-area-inset-right, 0px) + 72px); width: min(380px, calc(100vw - 24px)); height: min(65dvh, 540px); min-width: 180px; min-height: 150px; display: flex; flex-direction: column; background: var(--menu-panel, rgba(5,18,34,.96)); border: 1px solid var(--menu-border, rgba(0,255,255,.4)); border-radius: 14px; box-shadow: 0 18px 40px rgba(0,0,0,.42), var(--menu-shadow, 0 0 12px rgba(0,245,255,.18)); overflow: hidden; }
.shorts-search-window.dragging, .shorts-search-window.resizing { -webkit-user-select: none; user-select: none; will-change: transform, left, top; }
.shorts-search-window.dragging { cursor: grabbing; }
.shorts-search-window.resizing { cursor: nwse-resize; }
.shorts-search-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px 7px; border-bottom: 1px solid rgba(255,255,255,.08); cursor: grab; touch-action: none; }
.shorts-search-title { font-size: .88rem; font-weight: 600; color: var(--menu-accent, #00f5ff); letter-spacing: .02em; }
.shorts-search-close { width: 26px; height: 26px; border: none; background: transparent; color: var(--menu-text, #e0e6ed); border-radius: 999px; font-size: 1.1rem; line-height: 1; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.shorts-search-close:hover { background: rgba(255,255,255,.08); }
.shorts-search-form { display: flex; align-items: center; gap: 6px; padding: 8px 12px; border-bottom: 1px solid rgba(255,255,255,.06); }
.shorts-search-form input { flex: 1; min-width: 0; border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.06); color: var(--menu-text, #e0e6ed); border-radius: 999px; padding: 7px 13px; font-size: .85rem; outline: none; transition: border-color .15s, box-shadow .15s; }
.shorts-search-form input::placeholder { color: var(--menu-muted, #7c8ea3); }
.shorts-search-form input:focus { border-color: var(--menu-accent, #00f5ff); box-shadow: 0 0 0 2px rgba(0,245,255,.14); }
.shorts-search-submit { width: 34px; height: 34px; flex: 0 0 34px; border: none; border-radius: 999px; background: var(--menu-accent, #00f5ff); color: #031018; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.shorts-search-submit svg { pointer-events: none; }
.shorts-search-results { display: flex; flex-direction: column; gap: 4px; padding: 8px 10px; overflow-y: auto; flex: 1 1 0; min-height: 0; }
.shorts-search-status { padding: 14px 8px; text-align: center; color: var(--menu-muted, #7c8ea3); font-size: .82rem; }
.shorts-search-result { width: 100%; display: flex; flex-direction: column; gap: 2px; padding: 8px 11px; border: 1px solid rgba(255,255,255,.06); border-radius: 10px; background: rgba(255,255,255,.03); color: var(--menu-text, #e0e6ed); text-align: left; cursor: pointer; transition: border-color .15s, background .15s; }
.shorts-search-result:hover { border-color: var(--menu-accent, #00f5ff); background: rgba(0,245,255,.07); }
.shorts-search-result-title { font-size: .82rem; font-weight: 600; line-height: 1.35; color: var(--menu-text, #f2fbff); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shorts-search-result-meta { font-size: .7rem; text-transform: uppercase; letter-spacing: .07em; color: var(--menu-muted, #88a0b6); }
.shorts-search-result-tags { font-size: .72rem; color: var(--menu-accent, #7bf8ff); line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shorts-search-resize { position: absolute; bottom: 0; right: 0; width: 18px; height: 18px; cursor: nwse-resize; z-index: 2; opacity: .35; transition: opacity .15s; }
.shorts-search-resize:hover { opacity: .7; }
.shorts-search-resize::after { content: ''; position: absolute; bottom: 4px; right: 4px; width: 8px; height: 8px; border-right: 2px solid var(--menu-muted, #7c8ea3); border-bottom: 2px solid var(--menu-muted, #7c8ea3); }
body.theme-dark .shorts-search-window { background: rgba(22,27,34,.98); border-color: #30363d; box-shadow: 0 18px 40px rgba(0,0,0,.52); }
body.theme-dark .shorts-search-title { color: #58a6ff; }
body.theme-grey .shorts-search-window { background: #1e1e1e; border-color: #3c3c3c; box-shadow: 0 18px 40px rgba(0,0,0,.52); }
body.theme-grey .shorts-search-title { color: #4fc3f7; }
body.theme-white .shorts-search-window { background: linear-gradient(180deg, rgba(255,255,255,.97) 0%, rgba(234,241,249,.96) 100%); border-color: rgba(140,170,210,.6); box-shadow: 0 18px 40px rgba(0,20,60,.18); }
body.theme-white .shorts-search-title { color: #0f5aa6; }
body.theme-white .shorts-search-form input { background: rgba(255,255,255,.8); border-color: rgba(130,160,195,.32); color: #11283c; }
body.theme-white .shorts-search-form input::placeholder { color: #6b8092; }
body.theme-white .shorts-search-result { background: rgba(255,255,255,.74); border-color: rgba(140,170,210,.35); color: #11283c; }
body.theme-white .shorts-search-result-title { color: #11283c; }
body.theme-white .shorts-search-result-meta { color: #5f7388; }
@media (max-width: 700px) {
  .shorts-search-window { width: 50vw; height: min(43dvh, 364px); right: 10px; left: auto; min-width: 180px; min-height: 150px; }
}

/* ── My Uploads panel ── */
.myuploads-panel { position: fixed; inset: 0; z-index: 200; background: rgba(0,0,0,.7); display: flex; align-items: flex-end; justify-content: center; opacity: 0; pointer-events: none; transition: opacity .25s; }
.myuploads-panel.open { opacity: 1; pointer-events: auto; }
.myuploads-sheet { width: 100%; max-width: 480px; max-height: 60dvh; background: var(--menu-panel, #061225); border-radius: 16px 16px 0 0; padding: 16px; overflow-y: auto; transform: translateY(100%); transition: transform .3s cubic-bezier(.4,0,.2,1); }
.myuploads-panel.open .myuploads-sheet { transform: translateY(0); }
.myuploads-sheet h3 { margin-bottom: 12px; font-size: 1rem; color: var(--menu-accent, #00f5ff); }
.myuploads-list { display: flex; flex-direction: column; gap: 6px; }
.myuploads-item { padding: 10px 12px; border-radius: 8px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); font-size: .85rem; color: var(--menu-text, #e0e6ed); display: flex; justify-content: space-between; align-items: center; }
.myuploads-item-name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.myuploads-item-rename { padding: 4px 8px; border-radius: 4px; border: none; background: rgba(64,160,255,.2); color: #40a0ff; font-size: .75rem; cursor: pointer; transition: background .15s; margin-right: 4px; }
.myuploads-item-rename:hover { background: rgba(64,160,255,.4); }
.myuploads-item-delete { padding: 4px 8px; border-radius: 4px; border: none; background: rgba(255,64,64,.2); color: #ff4040; font-size: .75rem; cursor: pointer; transition: background .15s; }
.myuploads-item-delete:hover { background: rgba(255,64,64,.4); }
.myuploads-empty { padding: 20px; text-align: center; color: var(--menu-muted, #5a6a7a); font-size: .9rem; }

/* ── TikTok-style right overlay (below arrows) ── */
.slide-actions { position: absolute; right: 13px; top: 50%; bottom: auto; transform: translateY(-50%); z-index: 38; display: flex; flex-direction: column; align-items: center; gap: 18px; transition: right 1s cubic-bezier(.4,0,.2,1); }
.slide-actions.panel-open { right: 410px; }
.sa-btn { background: transparent; border: none; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 3px; color: #fff; -webkit-tap-highlight-color: transparent; padding: 0; }
.sa-btn svg { width: 32px; height: 32px; filter: drop-shadow(0 1px 2px rgba(0,0,0,.5)); transition: transform .2s, color .2s, fill .2s; fill: none; stroke: #fff; stroke-width: 1.8; }
.sa-btn:active svg { transform: scale(1.25); }
.sa-btn .sa-count { font-size: .75rem; font-weight: 700; color: #fff; text-shadow: 0 0 4px #000, 0 0 4px #000, 0 1px 6px rgba(0,0,0,.9), 1px 0 3px rgba(0,0,0,.7), -1px 0 3px rgba(0,0,0,.7); line-height: 1; letter-spacing: .02em; }
.sa-btn.hearted svg { fill: #ff2d55; stroke: #ff2d55; color: #ff2d55; }
.sa-btn.faved svg { fill: #ffd600; stroke: #ffd600; color: #ffd600; }
.sa-btn.cc-on svg { fill: rgba(255,255,255,.15); stroke: #fff; }
.sa-btn.cc-on .sa-count { color: #00f5ff; }
.sa-btn:not(.cc-on).sa-cc svg { opacity: .5; }
.sa-btn:not(.cc-on).sa-cc .sa-count { opacity: .5; }
.sa-menu-toggle { background: none !important; border: none !important; box-shadow: none !important; }
.sa-menu-toggle svg { stroke: #fff; stroke-width: 2.5; opacity: .85; }
.sa-menu-toggle .sa-count { display: none; }

/* ── Shield shorts buttons from global theme overrides ── */
body.theme-grey .sa-btn,
body.theme-white .sa-btn,
body.theme-grey .nav-arrow,
body.theme-white .nav-arrow,
body.theme-grey .history-clear,
body.theme-white .history-clear { background: transparent !important; border: none !important; box-shadow: none !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
body.theme-grey .nav-arrow:hover,
body.theme-white .nav-arrow:hover { background: rgba(255,255,255,.12) !important; }
body.theme-grey .sa-btn svg,
body.theme-white .sa-btn svg { fill: none !important; stroke: #fff !important; }
body.theme-grey .sa-btn.hearted svg,
body.theme-white .sa-btn.hearted svg { fill: #ff2d55 !important; stroke: #ff2d55 !important; }
body.theme-grey .sa-btn.faved svg,
body.theme-white .sa-btn.faved svg { fill: #ffd600 !important; stroke: #ffd600 !important; }
body.theme-grey .sa-btn.cc-on svg,
body.theme-white .sa-btn.cc-on svg { fill: rgba(255,255,255,.15) !important; stroke: #fff !important; }
/* Kill backdrop-filter on all shorts-page buttons (white theme FPS fix) */
body.theme-white .shorts-app button { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
body.theme-white .shorts-app video { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
/* Kill drop-shadow filters on white theme mobile */
body.theme-white .sa-btn svg { filter: none !important; }
body.theme-white .watched-badge { filter: none !important; }
/* Force white text on shorts overlays — counters global theme-white span/p/button color overrides */
body.theme-white .sa-btn .sa-count { color: #fff !important; text-shadow: 0 0 4px #000, 0 0 4px #000, 0 1px 6px rgba(0,0,0,.9), 1px 0 3px rgba(0,0,0,.7), -1px 0 3px rgba(0,0,0,.7) !important; }
body.theme-white .sa-btn.cc-on .sa-count { color: #fff !important; }
body.theme-white .video-caption { color: #fff !important; text-shadow: 0 1px 3px rgba(0,0,0,.9), 0 0 8px rgba(0,0,0,.6) !important; }
body.theme-white .video-caption .cap-text { color: #fff !important; }
body.theme-white .video-name { color: rgba(255,255,255,.75) !important; text-shadow: 0 1px 4px #000 !important; }
body.theme-white .video-name .vn-text { color: rgba(255,255,255,.88) !important; text-shadow: 0 1px 4px #000 !important; }
body.theme-white .video-name .vn-tags .vn-tag { color: rgba(0,200,255,.9) !important; text-shadow: 0 1px 4px #000 !important; }
body.theme-white .video-name .vn-more { color: rgba(255,255,255,.5) !important; text-shadow: 0 1px 4px #000 !important; }
body.theme-white .video-translation { color: rgba(180,220,255,.85) !important; text-shadow: 0 1px 4px #000, 0 0 6px rgba(0,0,0,.8) !important; }
body.theme-white .sa-btn { color: #fff !important; }

/* ── Comment panel (right-side slide) ── */
.comment-panel { position: fixed; top: 0; right: 0; bottom: 0; z-index: 300; width: 400px; max-width: 85vw; background: var(--menu-panel, #0a1628); display: flex; flex-direction: column; transform: translateX(100%); transition: transform 1s cubic-bezier(.4,0,.2,1); pointer-events: none; box-shadow: -4px 0 24px rgba(0,0,0,.5); }
.comment-panel.open { transform: translateX(0); pointer-events: auto; }

/* Backdrop overlay when comment panel is open */
.comment-backdrop { position: fixed; inset: 0; z-index: 299; background: rgba(0,0,0,.5); opacity: 0; pointer-events: none; transition: opacity 1s cubic-bezier(.4,0,.2,1); }
.comment-backdrop.open { opacity: 1; pointer-events: auto; }

.comment-sheet { width: 100%; height: 100%; display: flex; flex-direction: column; }
.comment-header { padding: 14px 16px 8px; font-size: .95rem; font-weight: 600; color: var(--menu-accent, #00f5ff); border-bottom: 1px solid rgba(255,255,255,.06); display: flex; justify-content: space-between; align-items: center; flex-shrink: 0; }
.comment-header .close-x { background: none; border: none; color: var(--menu-muted, #5a6a7a); font-size: 1.3rem; cursor: pointer; padding: 0 4px; }
.comment-list { flex: 1 1 0; overflow-y: auto; padding: 8px 16px; }
.comment-item { padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,.04); }
.comment-item .cm-meta { font-size: .7rem; color: var(--menu-muted, #5a6a7a); margin-bottom: 2px; }
.comment-item .cm-meta .cm-me { color: var(--menu-accent, #00f5ff); }
.comment-item .cm-text { font-size: .85rem; color: var(--menu-text, #e0e6ed); word-break: break-word; }
.comment-input-row { display: flex; gap: 8px; padding: 10px 16px; border-top: 1px solid rgba(255,255,255,.06); flex-shrink: 0; }
.comment-input-row input { flex: 1; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); border-radius: 20px; padding: 8px 14px; color: var(--menu-text, #e0e6ed); font-size: .85rem; outline: none; }
.comment-input-row input::placeholder { color: var(--menu-muted, #5a6a7a); }
.comment-input-row button { background: var(--menu-accent, #00f5ff); color: #000; border: none; border-radius: 20px; padding: 8px 18px; font-size: .82rem; font-weight: 600; cursor: pointer; white-space: nowrap; }

/* Comment panel theme overrides */
body.theme-dark .comment-panel { background: #0d1117; }
body.theme-dark .comment-header { color: #58a6ff; border-bottom-color: #21262d; }
body.theme-dark .comment-header .close-x { color: #8b949e; }
body.theme-dark .comment-item { border-bottom-color: #21262d; }
body.theme-dark .comment-item .cm-meta { color: #8b949e; }
body.theme-dark .comment-item .cm-meta .cm-me { color: #58a6ff; }
body.theme-dark .comment-item .cm-text { color: #c9d1d9; }
body.theme-dark .comment-input-row { border-top-color: #21262d; }
body.theme-dark .comment-input-row input { background: #161b22; border-color: #30363d; color: #c9d1d9; }
body.theme-dark .comment-input-row input::placeholder { color: #484f58; }
body.theme-dark .comment-input-row button { background: #58a6ff; color: #0d1117; }

body.theme-grey .comment-panel { background: #1e1e1e; }
body.theme-grey .comment-header { color: #4fc1ff; border-bottom-color: #333; }
body.theme-grey .comment-header .close-x { color: #969696; }
body.theme-grey .comment-item { border-bottom-color: #333; }
body.theme-grey .comment-item .cm-meta { color: #969696; }
body.theme-grey .comment-item .cm-meta .cm-me { color: #4fc1ff; }
body.theme-grey .comment-item .cm-text { color: #d4d4d4; }
body.theme-grey .comment-input-row { border-top-color: #333; }
body.theme-grey .comment-input-row input { background: #2d2d2d; border-color: #3c3c3c; color: #d4d4d4; }
body.theme-grey .comment-input-row input::placeholder { color: #666; }
body.theme-grey .comment-input-row button { background: #007acc; color: #fff; }

body.theme-white .comment-panel { background: #f0f4f8; box-shadow: -4px 0 24px rgba(0,0,0,.12); }
body.theme-white .comment-header { color: #0065c0; border-bottom-color: rgba(0,0,0,.08); }
body.theme-white .comment-header .close-x { color: #666; }
body.theme-white .comment-item { border-bottom-color: rgba(0,0,0,.06); }
body.theme-white .comment-item .cm-meta { color: #666; }
body.theme-white .comment-item .cm-meta .cm-me { color: #0065c0; }
body.theme-white .comment-item .cm-text { color: #222; }
body.theme-white .comment-input-row { border-top-color: rgba(0,0,0,.08); }
body.theme-white .comment-input-row input { background: #fff; border-color: rgba(0,0,0,.15); color: #222; }
body.theme-white .comment-input-row input::placeholder { color: #999; }
body.theme-white .comment-input-row button { background: #0065c0; color: #fff; }

/* Comment login gate */
.comment-login-gate { text-align: center; color: var(--menu-muted, #5a6a7a); font-size: .84rem; padding: 24px 16px; }
.comment-login-gate a { display: inline-block; padding: 8px 24px; border-radius: 20px; background: var(--menu-accent, #00f5ff); color: #000; font-weight: 600; text-decoration: none; font-size: .84rem; margin-top: 10px; }
body.theme-dark .comment-login-gate { color: #8b949e; }
body.theme-dark .comment-login-gate a { background: #58a6ff; color: #0d1117; }
body.theme-grey .comment-login-gate { color: #969696; }
body.theme-grey .comment-login-gate a { background: #007acc; color: #fff; }
body.theme-white .comment-login-gate { color: #666; }
body.theme-white .comment-login-gate a { background: #0065c0; color: #fff; }

/* ── Favourites panel (grid) ── */
.fav-panel { position: fixed; inset: 0; z-index: 250; background: rgba(0,0,0,.7); display: flex; align-items: flex-end; justify-content: center; opacity: 0; pointer-events: none; transition: opacity .25s; }
.fav-panel.open { opacity: 1; pointer-events: auto; }
.fav-sheet { width: 100%; max-width: 600px; max-height: 70dvh; background: var(--menu-panel, #0a1628); border-radius: 16px 16px 0 0; padding: 16px; overflow-y: auto; transform: translateY(100%); transition: transform .3s cubic-bezier(.4,0,.2,1); }
.fav-panel.open .fav-sheet { transform: translateY(0); }
.fav-sheet h3 { margin-bottom: 12px; font-size: 1rem; color: var(--menu-accent, #00f5ff); }
.fav-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
.fav-card { background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08); border-radius: 10px; overflow: hidden; cursor: pointer; transition: border-color .2s, box-shadow .2s; display: flex; flex-direction: column; }
.fav-card:hover { border-color: var(--menu-accent, #00f5ff); box-shadow: 0 0 10px rgba(0,245,255,.2); }
.fav-card-thumb { position: relative; width: 100%; aspect-ratio: 9 / 16; background: #000; overflow: hidden; }
.fav-card-thumb video { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.fav-card-name { padding: 6px 8px; font-size: .78rem; color: var(--menu-text, #e0e6ed); overflow: hidden; white-space: nowrap; position: relative; }
.fav-card-name span { display: inline-block; }
.fav-card-name.is-overflow span { animation: fav-marquee 6s linear infinite; }
@keyframes fav-marquee { 0% { transform: translateX(0); } 35% { transform: translateX(0); } 100% { transform: translateX(calc(-100% - 30px)); } }
.fav-empty { color: var(--menu-muted, #5a6a7a); font-size: .85rem; padding: 24px 0; text-align: center; }
/* Fav panel theme overrides */
body.theme-dark .fav-sheet { background: #0d1117; }
body.theme-dark .fav-sheet h3 { color: #58a6ff; }
body.theme-dark .fav-card { background: rgba(255,255,255,.03); border-color: #21262d; }
body.theme-dark .fav-card:hover { border-color: #58a6ff; box-shadow: 0 0 10px rgba(88,166,255,.15); }
body.theme-dark .fav-card-name { color: #c9d1d9; }
body.theme-dark .fav-empty { color: #484f58; }
body.theme-grey .fav-sheet { background: #1e1e1e; }
body.theme-grey .fav-sheet h3 { color: #4fc1ff; }
body.theme-grey .fav-card { background: rgba(255,255,255,.03); border-color: #3c3c3c; }
body.theme-grey .fav-card:hover { border-color: #007acc; box-shadow: 0 0 10px rgba(0,122,204,.15); }
body.theme-grey .fav-card-name { color: #d4d4d4; }
body.theme-grey .fav-empty { color: #666; }
body.theme-white .fav-sheet { background: #f0f4f8; }
body.theme-white .fav-sheet h3 { color: #0065c0; }
body.theme-white .fav-card { background: #fff; border-color: rgba(0,0,0,.08); }
body.theme-white .fav-card:hover { border-color: #0065c0; box-shadow: 0 0 10px rgba(0,101,192,.12); }
body.theme-white .fav-card-name { color: #222; }
body.theme-white .fav-empty { color: #999; }

/* ── Upload panel ── */
.upload-panel { position: fixed; inset: 0; z-index: 270; background: rgba(0,0,0,.7); display: flex; align-items: flex-end; justify-content: center; opacity: 0; pointer-events: none; transition: opacity .25s; }
.upload-panel.open { opacity: 1; pointer-events: auto; }
.upload-sheet { width: 100%; max-width: 440px; max-height: 92vh; background: var(--menu-panel, #0a1628); border-radius: 16px 16px 0 0; padding: 0; overflow: hidden; transform: translateY(100%); transition: transform .3s cubic-bezier(.4,0,.2,1); }
.upload-panel.open .upload-sheet { transform: translateY(0); }
.upload-header { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid rgba(255,255,255,.06); font-size: .95rem; font-weight: 600; color: var(--menu-accent, #00f5ff); }
.upload-header .close-x { background: none; border: none; color: var(--menu-text, #e0e6ed); font-size: 1.4rem; cursor: pointer; }
.upload-body { padding: 14px 14px 20px; overflow-y: auto; max-height: calc(92vh - 48px); }
.upload-login-gate { text-align: center; color: var(--menu-text, #e0e6ed); font-size: .88rem; }
.upload-login-gate p { margin: 0 0 14px; }
.upload-login-link { display: inline-block; padding: 10px 28px; border-radius: 20px; background: var(--menu-accent, #00f5ff); color: #000; font-weight: 600; text-decoration: none; font-size: .88rem; }
.upload-drop { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 24px 16px; border: 2px dashed rgba(255,255,255,.15); border-radius: 12px; cursor: pointer; color: var(--menu-muted, #5a6a7a); font-size: .85rem; text-align: center; transition: border-color .2s, background .2s; }
.upload-drop:hover { border-color: var(--menu-accent, #00f5ff); color: var(--menu-text, #e0e6ed); background: rgba(0,245,255,.03); }
.upload-drop-hint { font-size: .7rem; opacity: .5; }
.upload-progress { height: 4px; border-radius: 2px; background: rgba(255,255,255,.08); margin: 12px 0; overflow: hidden; }
.upload-progress-bar { height: 100%; width: 0; background: var(--menu-accent, #00f5ff); border-radius: 2px; transition: width .3s; }
.upload-status { font-size: .78rem; color: var(--menu-muted, #5a6a7a); min-height: 1.2em; margin-bottom: 8px; }
.upload-status.error { color: #ff4455; }
.upload-submit { width: 100%; padding: 12px; border-radius: 22px; border: none; background: linear-gradient(135deg, #fe2c55, #ff0050); color: #fff; font-size: .9rem; font-weight: 700; cursor: pointer; transition: opacity .2s, transform .1s; letter-spacing: .02em; }
.upload-submit:active { transform: scale(.97); }
.upload-submit:disabled { opacity: .35; cursor: default; }

/* ── Upload name input ── */
.upload-name-row { margin: 10px 0 0; }
.upload-name-label { display: block; font-size: .72rem; color: var(--menu-muted, #5a6a7a); margin-bottom: 4px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.upload-name-input { width: 100%; padding: 8px 12px; border-radius: 8px; border: 1px solid rgba(255,255,255,.1); background: rgba(255,255,255,.05); color: var(--menu-text, #e0e6ed); font-size: .84rem; outline: none; transition: border-color .2s; box-sizing: border-box; }
.upload-name-input:focus { border-color: var(--menu-accent, #00f5ff); }
.upload-name-input::placeholder { color: var(--menu-muted, #5a6a7a); }
body.theme-dark .upload-name-input { background: #0d1117; border-color: #30363d; color: #c9d1d9; }
body.theme-dark .upload-name-input:focus { border-color: #58a6ff; }
body.theme-dark .upload-name-label { color: #8b949e; }

/* ── Upload video preview ── */
.upload-preview { margin: 10px 0 0; position: relative; border-radius: 10px; overflow: hidden; background: #000; }
.upload-preview video { width: 100%; max-height: 220px; object-fit: contain; display: block; }
.upload-preview-change { position: absolute; top: 6px; right: 6px; display: flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 14px; border: none; background: rgba(0,0,0,.6); color: #fff; font-size: .68rem; font-weight: 600; cursor: pointer; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); transition: background .2s; }
.upload-preview-change:hover { background: rgba(0,0,0,.85); }
.up-preview-bar { display: flex; align-items: center; gap: 6px; padding: 4px 10px 6px; background: rgba(0,0,0,.5); }
.up-time { font-size: .65rem; color: rgba(255,255,255,.7); font-variant-numeric: tabular-nums; min-width: 28px; }
.up-seeker { flex: 1; height: 3px; -webkit-appearance: none; appearance: none; background: rgba(255,255,255,.2); border-radius: 2px; outline: none; cursor: pointer; }
.up-seeker::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: none; box-shadow: 0 0 4px rgba(0,0,0,.5); }
.up-seeker::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: #fff; border: none; }
.up-watermark-warn { display: flex; align-items: center; gap: 6px; padding: 6px 10px; background: rgba(255,68,85,.12); border-radius: 0 0 10px 10px; font-size: .72rem; color: #ff4455; font-weight: 600; }

/* ── Upload hashtags row ── */
.upload-hashtags-row { margin: 10px 0 0; }
.upload-tag-picker { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.up-tag-chip { padding: 4px 10px; border-radius: 14px; border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.04); color: var(--menu-muted, #8b949e); font-size: .72rem; font-weight: 600; cursor: pointer; transition: background .2s, border-color .2s, color .2s; }
.up-tag-chip:hover { border-color: rgba(0,245,255,.35); color: var(--menu-text, #e0e6ed); }
.up-tag-chip.active { border-color: var(--menu-accent, #00f5ff); background: rgba(0,245,255,.12); color: var(--menu-accent, #00f5ff); }

/* ── Upload effects picker ── */
.upload-effects-row { margin: 10px 0 0; }
.upload-effects-list { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0; scrollbar-width: none; }
.upload-effects-list::-webkit-scrollbar { display: none; }
.upload-effect-btn { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 10px; border-radius: 10px; border: 1.5px solid rgba(255,255,255,.08); background: rgba(255,255,255,.03); color: var(--menu-muted, #5a6a7a); cursor: pointer; transition: border-color .2s, background .2s, color .2s; min-width: 56px; }
.upload-effect-btn:hover { border-color: rgba(255,255,255,.2); background: rgba(255,255,255,.06); color: var(--menu-text, #e0e6ed); }
.upload-effect-btn.active { border-color: var(--menu-accent, #00f5ff); background: rgba(0,245,255,.08); color: var(--menu-accent, #00f5ff); }
.ue-icon { display: flex; align-items: center; justify-content: center; width: 24px; height: 24px; }
.ue-icon svg { display: block; }
.ue-label { font-size: .62rem; font-weight: 600; white-space: nowrap; }
body.theme-dark .upload-effect-btn { border-color: #30363d; background: #0d1117; color: #8b949e; }
body.theme-dark .upload-effect-btn:hover { border-color: #484f58; background: #161b22; color: #c9d1d9; }
body.theme-dark .upload-effect-btn.active { border-color: #58a6ff; background: rgba(88,166,255,.1); color: #58a6ff; }

/* ── Upload panel theme overrides (dark / grey / aero) ── */
body.theme-dark .upload-sheet { background: #0d1117; }
body.theme-dark .upload-header { color: #58a6ff; border-bottom-color: #21262d; }
body.theme-dark .upload-header .close-x { color: #c9d1d9; }
body.theme-dark .upload-login-gate { color: #c9d1d9; }
body.theme-dark .upload-login-link { background: #58a6ff; color: #0d1117; }
body.theme-dark .upload-drop { border-color: #30363d; color: #8b949e; }
body.theme-dark .upload-drop:hover { border-color: #58a6ff; color: #c9d1d9; background: rgba(88,166,255,.04); }

body.theme-grey .upload-sheet { background: #1e1e1e; }
body.theme-grey .upload-header { color: #4fc1ff; border-bottom-color: #333; }
body.theme-grey .upload-header .close-x { color: #d4d4d4; }
body.theme-grey .upload-login-gate { color: #d4d4d4; }
body.theme-grey .upload-login-link { background: #007acc; color: #fff; }
body.theme-grey .upload-drop { border-color: #3c3c3c; color: #969696; }
body.theme-grey .upload-drop:hover { border-color: #007acc; color: #d4d4d4; background: rgba(0,122,204,.06); }
body.theme-grey .upload-name-input { background: #2d2d2d; border-color: #3c3c3c; color: #d4d4d4; }
body.theme-grey .upload-name-input:focus { border-color: #007acc; }
body.theme-grey .upload-name-label { color: #969696; }
body.theme-grey .upload-effect-btn { border-color: #3c3c3c; background: #252526; color: #969696; }
body.theme-grey .upload-effect-btn:hover { border-color: #505050; background: #2d2d2d; color: #d4d4d4; }
body.theme-grey .upload-effect-btn.active { border-color: #007acc; background: rgba(0,122,204,.12); color: #4fc1ff; }

body.theme-white .upload-sheet { background: #f0f4f8; }
body.theme-white .upload-header { color: #0065c0; border-bottom-color: rgba(0,0,0,.08); }
body.theme-white .upload-header .close-x { color: #333; }
body.theme-white .upload-login-gate { color: #222; }
body.theme-white .upload-login-link { background: #0065c0; color: #fff; }
body.theme-white .upload-drop { border-color: rgba(0,0,0,.15); color: #666; }
body.theme-white .upload-drop:hover { border-color: #0065c0; color: #222; background: rgba(0,101,192,.04); }
body.theme-white .upload-name-input { background: #fff; border-color: rgba(0,0,0,.15); color: #222; }
body.theme-white .upload-name-input:focus { border-color: #0065c0; }
body.theme-white .upload-name-input::placeholder { color: #999; }
body.theme-white .upload-name-label { color: #666; }
body.theme-white .upload-effect-btn { border-color: rgba(0,0,0,.12); background: #fff; color: #666; }
body.theme-white .upload-effect-btn:hover { border-color: rgba(0,0,0,.2); background: #f5f7fa; color: #333; }
body.theme-white .upload-effect-btn.active { border-color: #0065c0; background: rgba(0,101,192,.08); color: #0065c0; }

/* ── Effect timing row ── */
.up-timing-row { margin: 10px 0 0; }
.up-timing-inputs { display: flex; align-items: center; gap: 8px; }
.up-timing-field { flex: 1; }
.up-timing-field label { display: block; font-size: .65rem; color: var(--menu-muted, #5a6a7a); margin-bottom: 2px; }
.up-timing-input { width: 100%; padding: 6px 10px; font-size: .8rem; text-align: center; }
.up-timing-dash { color: var(--menu-muted, #5a6a7a); font-size: .9rem; margin-top: 12px; }
.up-timing-hint { font-size: .62rem; color: var(--menu-muted, #5a6a7a); margin-top: 4px; opacity: .7; }

/* ── Upload effect preview overlay ── */
.up-fx-overlay { position: absolute; inset: 0; pointer-events: none; z-index: 2; overflow: hidden; }
.up-fx-strobe { position: absolute; inset: 0; background: #fff; opacity: 0; transition: opacity 60ms; }
.up-fx-laser { position: absolute; inset: 0; width: 100%; height: 100%; }
/* Preview animations */
@keyframes upFxFlash { 0%,45% { opacity: var(--up-fx-strobe,0.7); } 50%,100% { opacity: 0; } }
@keyframes upFxStrobeMild { 0%,30% { opacity: var(--up-fx-strobe,0.35); } 35%,100% { opacity: 0; } }
.up-fx-overlay.fx-flash .up-fx-strobe { animation: upFxFlash .25s ease-in-out infinite; }
.up-fx-overlay.fx-strobe .up-fx-strobe { animation: upFxStrobeMild .5s ease-in-out infinite; }
.up-fx-overlay.fx-rave .up-fx-strobe { animation: upFxFlash .35s ease-in-out infinite; }

/* ── Upload intensity slider ── */
.up-intensity-row { margin: 10px 0 0; }
.up-intensity-wrap { display: flex; align-items: center; gap: 10px; }
.up-intensity-slider { flex: 1; height: 4px; accent-color: var(--menu-accent, #00f5ff); cursor: pointer; }
.up-intensity-val { font-size: .72rem; font-weight: 600; color: var(--menu-accent, #00f5ff); min-width: 32px; text-align: right; }

/* ── Cover strip ── */
.up-cover-row { margin: 10px 0 0; }
.up-cover-strip { display: flex; gap: 4px; overflow-x: auto; padding: 4px 0; scrollbar-width: none; }
.up-cover-strip::-webkit-scrollbar { display: none; }
.up-cover-strip canvas { flex: 0 0 auto; width: 54px; height: 72px; border-radius: 6px; object-fit: cover; cursor: pointer; border: 2px solid transparent; transition: border-color .2s; }
.up-cover-strip canvas.active { border-color: var(--menu-accent, #00f5ff); }

/* ── Visibility row ── */
.up-visibility-row { margin: 10px 0 0; }
.up-vis-btns { display: flex; gap: 6px; }
.up-vis-btn { flex: 1; display: flex; align-items: center; justify-content: center; gap: 4px; padding: 7px 6px; border-radius: 8px; border: 1.5px solid rgba(255,255,255,.08); background: rgba(255,255,255,.03); color: var(--menu-muted, #5a6a7a); font-size: .68rem; font-weight: 600; cursor: pointer; transition: all .2s; white-space: nowrap; }
.up-vis-btn:hover { border-color: rgba(255,255,255,.18); color: var(--menu-text, #e0e6ed); }
.up-vis-btn.active { border-color: var(--menu-accent, #00f5ff); background: rgba(0,245,255,.08); color: var(--menu-accent, #00f5ff); }

/* ── Mobile: tighter upload panel ── */
@media (max-width: 600px) {
  .upload-body { padding: 10px 10px 16px; }
  .upload-drop { padding: 18px 12px; gap: 6px; }
  .upload-drop svg { width: 32px; height: 32px; }
  .upload-drop-hint { font-size: .62rem; }
  .upload-preview video { max-height: 180px; }
  .upload-effect-btn { min-width: 48px; padding: 6px 7px; border-radius: 8px; }
  .ue-icon { width: 20px; height: 20px; }
  .ue-icon svg { width: 18px; height: 18px; }
  .ue-label { font-size: .56rem; }
  .upload-effects-list { gap: 4px; }
  .upload-name-input { padding: 7px 10px; font-size: .8rem; }
  .upload-name-label { font-size: .65rem; }
  .upload-submit { padding: 10px; font-size: .84rem; }
  .up-timing-input { padding: 5px 8px; font-size: .76rem; }
  .up-vis-btn { padding: 6px 4px; font-size: .62rem; }
  .up-cover-strip canvas { width: 44px; height: 58px; border-radius: 4px; }
}

/* ── Globe icon in category button ── */
.globe-icon { vertical-align: -2px; color: #4ea8ff; }
.cat-btn.active .globe-icon { color: #fff; }
body.theme-dark .cat-btn .globe-icon { color: #336699; }
body.theme-dark .cat-btn.active .globe-icon { color: #fff; }
body.theme-grey .cat-btn .globe-icon { color: #1a1a1a; }
body.theme-grey .cat-btn.active .globe-icon { color: #fff; }
body.theme-white .cat-btn.active .globe-icon { color: #0065c0; }
body.theme-grey .cat-btn-fav .cat-fav-icon { color: #c62828; fill: #c62828; }
body.theme-grey .cat-btn-fav.active .cat-fav-icon { color: #fff; fill: #fff; }
body.theme-white .cat-btn-fav.active .cat-fav-icon { color: #fff; fill: #fff; }

/* Fav icon in Favourites category button */
.cat-fav-icon { vertical-align: -2px; color: #ff6b8a; }
.cat-btn.active .cat-fav-icon { color: #fff; fill: #fff; }
body.theme-dark .cat-btn .cat-fav-icon { color: #e05070; fill: #e05070; }
body.theme-dark .cat-btn.active .cat-fav-icon { color: #fff; fill: #fff; }

/* Upload icon in Uploads category button */
.cat-upload-icon { vertical-align: -2px; color: #8b949e; }
.cat-btn.active .cat-upload-icon { color: #fff; stroke: #fff; }
body.theme-dark .cat-btn .cat-upload-icon { color: #555; stroke: #555; }
body.theme-dark .cat-btn.active .cat-upload-icon { color: #fff; stroke: #fff; }
body.theme-grey .cat-btn .cat-upload-icon { color: #555; stroke: #555; }
body.theme-grey .cat-btn.active .cat-upload-icon { color: #fff; stroke: #fff; }
body.theme-white .cat-btn.active .cat-upload-icon { color: #0065c0; stroke: #0065c0; }

/* Reflect active category on bar icon buttons */
.bar-icon-btn[data-cat].active svg { stroke: #000; }
body.theme-dark .bar-icon-btn[data-cat].active svg { stroke: #fff; }
body.theme-dark .bar-icon-btn[data-cat] svg { stroke: #1a1a2e; }
body.theme-white .bar-icon-btn[data-cat].active svg { stroke: #0065c0; }

/* ── Grey theme: bottom bar icon buttons (inverted: inactive=black, active=white) ── */
body.theme-grey .bar-icon-btn { background: #bfbfbf; border-color: #999; color: #1a1a1a; }
body.theme-grey .bar-icon-btn:hover { background: #d0d0d0; border-color: #777; }
body.theme-grey .bar-icon-btn.active { background: #333; color: #fff; border-color: #555; box-shadow: 0 0 10px rgba(255,255,255,.15); }
body.theme-grey .bar-icon-btn.active:hover { background: #444; border-color: #666; }
body.theme-grey .bar-icon-btn[data-cat] svg { stroke: #1a1a1a; }
body.theme-grey .bar-icon-btn[data-cat].active svg { stroke: #fff; }
body.theme-grey .bar-icon-btn.bar-menu-toggle svg { stroke: #1a1a1a; }
body.theme-grey .bar-icon-btn.bar-menu-toggle.active svg { stroke: #fff; }

/* ── Mute toggle button (fixed, next to home button) ── */
.mute-toggle {
  display: none !important;
  position: fixed;
  left: calc(env(safe-area-inset-left, 0px) + 84px);
  top: calc(env(safe-area-inset-top, 0px) + 8px);
  z-index: 3100002;
  width: 34px; height: 30px;
  border-radius: 7px;
  border: 1px solid var(--menu-border, rgba(0,255,255,.7));
  background: var(--menu-panel, rgba(5,18,34,.92));
  color: var(--menu-text, #d3fcff);
  box-shadow: var(--menu-shadow, 0 0 12px rgba(0,245,255,.3));
  cursor: pointer;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background .2s;
}
.mute-toggle:hover { background: var(--menu-accent, rgba(0,255,255,.85)); color: #00131a; }
.mute-toggle:active { background: var(--menu-accent, rgba(0,255,255,.85)); color: #00131a; }
.mute-toggle svg { display: block; margin: auto; pointer-events: none; }
.mute-toggle .mt-off { display: none; }
.mute-toggle.is-muted .mt-on { display: none; }
.mute-toggle.is-muted .mt-off { display: block; }
/* Theme overrides — match home button styling */
body.theme-dark .mute-toggle { border-color: #30363d; background: rgba(22,27,34,0.92); color: #c9d1d9; box-shadow: none; }
body.theme-dark .mute-toggle:hover { background: #58a6ff; color: #0d1117; }
body.theme-grey .mute-toggle { border-color: #3c3c3c; background: #252526; color: #d4d4d4; box-shadow: none; }
body.theme-grey .mute-toggle:hover { background: #007acc; color: #fff; }
body.theme-white .mute-toggle { border: 1px solid rgba(140,170,210,.6); background: linear-gradient(180deg, rgba(255,255,255,.85) 0%, rgba(228,235,245,.55) 50%, rgba(215,225,240,.6) 100%); color: #1a1a1a; box-shadow: 0 1px 3px rgba(0,20,60,.1), inset 0 1px 0 rgba(255,255,255,.9); border-radius: 4px; }
body.theme-white .mute-toggle:hover { background: linear-gradient(180deg, rgba(234,246,255,.9) 0%, rgba(190,220,248,.7) 50%, rgba(175,210,245,.75) 100%); color: #0a0a0a; border-color: rgba(80,130,195,.65); }
body.is-ios .mute-toggle { display: none !important; }

/* ── Mobile tweaks ── */
@media (max-width: 600px) {
  .mute-toggle { display: none !important; }
  .watched-badge { top: 20px; }
  /* Nav arrows: half-size, fully transparent, just the arrow glyph */
  .nav-arrow { width: 28px; height: 28px; font-size: .8rem; opacity: .55; background: transparent !important; border: none; }
  .nav-arrow:hover { background: transparent !important; }
  .nav-arrow { left: 6px; }
  .nav-arrow.right { bottom: calc(50% - 15px); }
  .bottom-bar { gap: 10px; padding: 6px 8px; overflow-x: auto; scrollbar-width: none; }
  .bottom-bar::-webkit-scrollbar { display: none; }
  .bar-icon-btn { width: 36px; height: 36px; flex-shrink: 0; }
  .cat-btn { padding: 7px 14px; font-size: .78rem; }
  .video-seeker { left: 0; right: 0; bottom: 0; padding: 0; gap: 0; background: transparent; border: none; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .progress-bar { height: 14px; }
  .progress-bar-thumb { display: none; }
  /* Video overlays stay below the mobile seeker */
  .video-name { font-size: .7rem; bottom: 36px; left: 8px; right: 70px; max-width: none; z-index: 12; transition: bottom .35s cubic-bezier(.4,0,.2,1); }
  .video-translation { font-size: .62rem; bottom: 22px; left: 8px; right: 70px; max-width: none; transition: bottom .35s cubic-bezier(.4,0,.2,1); }
  .video-caption { font-size: .72rem; bottom: 90px; left: 8px; right: 70px; transition: bottom .35s cubic-bezier(.4,0,.2,1); }
  .slide-actions { right: 9px; top: 50%; bottom: auto; transform: translateY(-50%); gap: 14px; }
  .slide-actions.panel-open { right: 9px; }
  .sa-btn svg { width: 28px; height: 28px; }
  .sa-btn .sa-count { font-size: .65rem; }

  .comment-panel { width: 100%; max-width: 100vw; top: auto; bottom: 0; height: 20vh; min-height: 120px; transform: translateY(100%); border-radius: 12px 12px 0 0; }
  .comment-panel.open { transform: translateY(0); }
  .comment-sheet { height: 100%; }
  .comment-list { flex: 1 1 0; overflow-y: auto; }
  .comment-input-row input { font-size: .78rem; padding: 6px 10px; }
  .comment-input-row button { font-size: .76rem; padding: 6px 12px; }
  .video-name { z-index: 301; }
  /* Hide the global player dock on mobile for more space */
  .global-player-dock { display: none !important; }
}

/* ── Disco laser effect (Adrinaline Dopamine) ── */
.disco-laser-container {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  overflow: hidden;
  opacity: 0;
  transition: opacity .4s ease;
}
.disco-laser-container.active { opacity: 1; }

.disco-laser-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.disco-strobe {
  position: absolute;
  inset: 0;
  background: #fff;
  opacity: 0;
  pointer-events: none;
  transition: none;
}

/* ── Glitch button (hamburger icon) ── */
.shorts-glitch-btn { position: fixed; left: calc(env(safe-area-inset-left, 0px) + 8px); top: calc(env(safe-area-inset-top, 0px) + 8px); z-index: 3100003; width: 34px; height: 30px; display: none; align-items: center; justify-content: center; border: 1px solid var(--menu-border, rgba(0,255,255,.7)); background: var(--menu-panel, rgba(5,18,34,.92)); color: var(--menu-text, #d3fcff); border-radius: 7px; box-shadow: var(--menu-shadow, 0 0 12px rgba(0,245,255,.3)); cursor: pointer; padding: 0; transition: background .2s, box-shadow .2s; }
body.is-knopper .shorts-glitch-btn { display: inline-flex; }
.shorts-glitch-btn:hover { background: var(--menu-accent, rgba(0,255,255,.85)); color: #00131a; }
.shorts-glitch-btn.glitch-active { border-color: #ff003c; box-shadow: 0 0 14px rgba(255,0,60,.6), 0 0 4px rgba(0,255,255,.3); background: rgba(255,0,60,.18); color: #ff003c; }
.shorts-glitch-btn.glitch-active:hover { background: rgba(255,0,60,.35); }
.shorts-glitch-btn svg { pointer-events: none; }
body.theme-dark .shorts-glitch-btn { border-color: #30363d; background: rgba(22,27,34,0.92); color: #c9d1d9; box-shadow: none; }
body.theme-dark .shorts-glitch-btn:hover { background: #58a6ff; color: #0d1117; }
body.theme-dark .shorts-glitch-btn.glitch-active { border-color: #ff003c; background: rgba(255,0,60,.2); color: #ff003c; box-shadow: 0 0 10px rgba(255,0,60,.4); }
body.theme-grey .shorts-glitch-btn { border-color: #3c3c3c; background: #252526; color: #d4d4d4; box-shadow: none; }
body.theme-grey .shorts-glitch-btn:hover { background: #007acc; color: #fff; }
body.theme-grey .shorts-glitch-btn.glitch-active { border-color: #ff003c; background: rgba(255,0,60,.18); color: #ff003c; }
body.theme-white .shorts-glitch-btn { border: 1px solid rgba(140,170,210,.6); background: linear-gradient(180deg, rgba(255,255,255,.85) 0%, rgba(228,235,245,.55) 50%, rgba(215,225,240,.6) 100%); color: #1a1a1a; box-shadow: 0 1px 3px rgba(0,20,60,.1), inset 0 1px 0 rgba(255,255,255,.9); border-radius: 4px; }
body.theme-white .shorts-glitch-btn:hover { background: linear-gradient(180deg, rgba(234,246,255,.9) 0%, rgba(190,220,248,.7) 50%, rgba(175,210,245,.75) 100%); color: #0a0a0a; }
body.theme-white .shorts-glitch-btn.glitch-active { border-color: #ff003c; background: rgba(255,0,60,.12); color: #d00030; }

/* ── Cyberpunk glitch overlay ── */
.cyber-glitch-overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  overflow: hidden;
  opacity: 0;
  transition: opacity .3s;
}
.cyber-glitch-overlay.active { opacity: 1; }

/* Scanlines */
.cyber-glitch-overlay::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 2px,
    rgba(0,0,0,.08) 2px,
    rgba(0,0,0,.08) 4px
  );
  animation: glitch-scanline-scroll 8s linear infinite;
  pointer-events: none;
}
@keyframes glitch-scanline-scroll {
  0% { background-position: 0 0; }
  100% { background-position: 0 200px; }
}

/* Chromatic aberration + flicker layer */
.cyber-glitch-overlay::after {
  content: '';
  position: absolute;
  inset: -2px;
  background: linear-gradient(
    180deg,
    rgba(255,0,60,.0) 0%,
    rgba(255,0,60,.04) 20%,
    rgba(0,255,255,.03) 40%,
    rgba(255,0,60,.0) 50%,
    rgba(0,255,255,.04) 70%,
    rgba(255,0,60,.03) 90%,
    rgba(0,255,255,.0) 100%
  );
  background-size: 100% 300%;
  animation: glitch-color-shift 4s ease-in-out infinite;
  pointer-events: none;
}
@keyframes glitch-color-shift {
  0%, 100% { background-position: 0 0%; }
  50% { background-position: 0 100%; }
}

/* Glitch bar elements */
.glitch-bar {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: rgba(255,0,60,.35);
  mix-blend-mode: screen;
  animation: glitch-bar-flicker 0.15s steps(2) infinite;
  pointer-events: none;
}
.glitch-bar:nth-child(2) { background: rgba(0,255,255,.3); animation-duration: 0.12s; }
.glitch-bar:nth-child(3) { background: rgba(255,0,60,.25); animation-duration: 0.18s; height: 3px; }
.glitch-bar:nth-child(4) { background: rgba(0,255,255,.2); animation-duration: 0.1s; }
.glitch-bar:nth-child(5) { background: rgba(255,255,0,.15); animation-duration: 0.2s; height: 1px; }
@keyframes glitch-bar-flicker {
  0% { opacity: 1; transform: translateX(0); }
  50% { opacity: 0; transform: translateX(-3px); }
  100% { opacity: 1; transform: translateX(2px); }
}

/* Big glitch tear — occasional horizontal shift */
.glitch-tear {
  position: absolute;
  left: 0;
  width: 100%;
  background: transparent;
  animation: glitch-tear-anim 3s steps(1) infinite;
  pointer-events: none;
  overflow: hidden;
}
.glitch-tear::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(255,0,60,.12) 0%, transparent 30%, rgba(0,255,255,.08) 70%, transparent 100%);
}
@keyframes glitch-tear-anim {
  0%, 4% { clip-path: inset(0); transform: translateX(0); }
  5% { clip-path: inset(0); transform: translateX(8px); }
  6% { clip-path: inset(0); transform: translateX(-5px); }
  7%, 100% { clip-path: inset(0); transform: translateX(0); opacity: 0; }
}
.glitch-tear:nth-child(7) { animation-delay: 1.2s; animation-duration: 4s; }
.glitch-tear:nth-child(8) { animation-delay: 2.5s; animation-duration: 5s; }

/* Vignette + CRT edge glow */
.glitch-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,.45) 100%);
  box-shadow: inset 0 0 80px rgba(0,255,255,.04), inset 0 0 30px rgba(255,0,60,.03);
}

/* ── Dark theme overrides for shorts ── */

/* Category buttons: dark theme — white when off, blue when on */
body.theme-dark .cat-btn {
  border-color: rgba(255,255,255,.18);
  background: rgba(255,255,255,.92);
  color: #1a1a2e;
}
body.theme-dark .cat-btn:hover {
  background: #fff;
  border-color: rgba(255,255,255,.35);
  color: #111;
}
body.theme-dark .cat-btn.active {
  background: #58a6ff;
  color: #fff;
  border-color: #58a6ff;
  font-weight: 600;
  box-shadow: 0 0 10px rgba(88,166,255,.45), 0 0 2px rgba(88,166,255,.25);
}
body.theme-dark .cat-btn.active:hover {
  background: #79b8ff;
  border-color: #79b8ff;
}

/* Bar icon buttons: dark theme — white when off, blue when on */
body.theme-dark .bar-icon-btn {
  border-color: rgba(255,255,255,.18);
  background: rgba(255,255,255,.92);
  color: #1a1a2e;
}
body.theme-dark .bar-icon-btn:hover {
  background: #fff;
  border-color: rgba(255,255,255,.35);
  color: #111;
}
body.theme-dark .bar-icon-btn.active {
  background: #58a6ff;
  color: #fff;
  border-color: #58a6ff;
  box-shadow: 0 0 10px rgba(88,166,255,.45);
}
body.theme-dark .bar-icon-btn.active:hover {
  background: #79b8ff;
  border-color: #79b8ff;
}

/* Bottom bar dark theme */
body.theme-dark .bottom-bar {
  background: #161b22;
  border-top-color: #30363d;
}

/* Category sheet dark theme */
body.theme-dark .cat-sheet {
  background: #161b22;
}
body.theme-dark .cat-sheet-title {
  color: #58a6ff;
}
body.theme-dark .cat-sheet-fav.fav-active {
  background: #ffd600;
  color: #000;
  border-color: #ffd600;
}

/* Action button text (Save, Share, Upload, counts) — enhanced visibility on dark backgrounds */
body.theme-dark .sa-btn .sa-count {
  color: #e6edf3;
  text-shadow: 0 0 6px rgba(0,0,0,.95), 0 1px 4px rgba(0,0,0,.9), 1px 0 4px rgba(0,0,0,.8), -1px 0 4px rgba(0,0,0,.8), 0 0 12px rgba(0,0,0,.7);
  font-weight: 700;
}
body.theme-dark .sa-btn svg {
  filter: drop-shadow(0 1px 3px rgba(0,0,0,.7));
}

/* ── Buffer progress indicator ── */
.buffer-bar { position: absolute; top: 0; left: 0; right: 0; height: 3px; z-index: 20; background: rgba(255,255,255,.1); opacity: 1; transition: opacity .4s; }
.buffer-bar.loaded { opacity: 0; }
.buffer-bar-fill { height: 100%; width: 0; background: linear-gradient(90deg, #00f5ff, #00c8ff); border-radius: 0 2px 2px 0; transition: width .3s; }

.buffer-spinner { position: absolute; top: 50%; left: 50%; z-index: 20; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 8px; opacity: 0; pointer-events: none; transition: opacity .3s; }
.buffer-spinner.visible { opacity: 1; }
.buffer-ring { width: 40px; height: 40px; border: 3px solid rgba(255,255,255,.15); border-top-color: #00f5ff; border-radius: 50%; animation: buf-spin .8s linear infinite; }
@keyframes buf-spin { to { transform: rotate(360deg); } }
.buffer-pct { font-size: .75rem; font-weight: 700; color: #fff; text-shadow: 0 0 6px rgba(0,0,0,.9), 0 1px 4px rgba(0,0,0,.8); line-height: 1; }

/* "Select All" button inside category sheet */
.cat-select-all {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 9px 20px;
  border-radius: 20px;
  border: 1.5px dashed rgba(255,255,255,.18);
  background: rgba(255,255,255,.02);
  color: var(--menu-muted, #5a6a7a);
  font-size: .88rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background .2s, color .2s, border-color .2s;
  -webkit-tap-highlight-color: transparent;
}
.cat-select-all:hover {
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.25);
  color: var(--menu-text, #e0e6ed);
}
.cat-select-all.all-active {
  background: var(--menu-accent, #00f5ff);
  color: #000;
  border-color: var(--menu-accent, #00f5ff);
  border-style: solid;
  font-weight: 600;
}
body.theme-dark .cat-select-all {
  border-color: rgba(255,255,255,.18);
  background: rgba(255,255,255,.85);
  color: #1a1a2e;
}
body.theme-dark .cat-select-all:hover {
  background: #fff;
  border-color: rgba(255,255,255,.35);
  color: #111;
}
body.theme-dark .cat-select-all.all-active {
  background: #58a6ff;
  color: #fff;
  border-color: #58a6ff;
  border-style: solid;
}

/* ── Grey theme: select-all button (inverted) ── */
body.theme-grey .cat-select-all {
  border-color: #999;
  background: #bfbfbf;
  color: #1a1a1a;
}
body.theme-grey .cat-select-all:hover {
  background: #d0d0d0;
  border-color: #777;
  color: #111;
}
body.theme-grey .cat-select-all.all-active {
  background: #333;
  color: #fff;
  border-color: #555;
  border-style: solid;
}

/* ── White theme: select-all button ── */
body.theme-white .cat-select-all {
  border: 1.5px dashed #b8d4f0;
  background: #e8f0fa;
  color: #3a5070;
}
body.theme-white .cat-select-all:hover {
  background: #d6e6f8;
  border-color: #90b8e0;
  color: #1a3050;
}
body.theme-white .cat-select-all.all-active {
  background: #0065c0;
  color: #fff;
  border-color: #0065c0;
  border-style: solid;
}

@media (max-width: 600px) {
  .shorts-glitch-btn,
  .shorts-home-btn,
  .shorts-reload-btn,
  .shorts-gmute-btn,
  .shorts-history-btn,
  .shorts-search-btn {
    top: calc(env(safe-area-inset-top, 0px) + 6px);
    width: 30px;
    height: 28px;
  }
  .shorts-glitch-btn { left: calc(env(safe-area-inset-left, 0px) + 6px); }
  .shorts-home-btn { left: calc(env(safe-area-inset-left, 0px) + 44px); }
  .shorts-reload-btn { left: calc(env(safe-area-inset-left, 0px) + 78px); }
  .shorts-gmute-btn { left: calc(env(safe-area-inset-left, 0px) + 112px); }
  .shorts-history-btn { left: calc(env(safe-area-inset-left, 0px) + 146px); }
  .shorts-search-btn { right: calc(env(safe-area-inset-right, 0px) + 6px); }
  .wipay-btn { right: calc(env(safe-area-inset-right, 0px) + 0px); }
}

@media (max-width: 380px) {
  .shorts-glitch-btn,
  .shorts-home-btn,
  .shorts-reload-btn,
  .shorts-gmute-btn,
  .shorts-history-btn,
  .shorts-search-btn {
    width: 28px;
    height: 26px;
  }
  .shorts-glitch-btn { left: calc(env(safe-area-inset-left, 0px) + 5px); }
  .shorts-home-btn { left: calc(env(safe-area-inset-left, 0px) + 43px); }
  .shorts-reload-btn { left: calc(env(safe-area-inset-left, 0px) + 74px); }
  .shorts-gmute-btn { left: calc(env(safe-area-inset-left, 0px) + 105px); }
  .shorts-history-btn { left: calc(env(safe-area-inset-left, 0px) + 136px); }
}

/* ═══════════ USER VISUAL EFFECTS (multi-stack) ═══════════ */

/* ── VHS / Retro ── */
.ufx-vhs-overlay { position: absolute; inset: 0; z-index: 3; pointer-events: none; overflow: hidden; opacity: 0; transition: opacity .3s; }
.ufx-vhs-overlay.active { opacity: 1; }
.ufx-vhs-scanlines {
  position: absolute; inset: 0;
  background: repeating-linear-gradient(0deg, rgba(0,0,0,.15) 0px, rgba(0,0,0,.15) 1px, transparent 1px, transparent 3px);
  animation: ufx-scanroll 8s linear infinite; pointer-events: none;
}
.ufx-vhs-noise {
  position: absolute; inset: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 200"><filter id="n"><feTurbulence type="fractalNoise" baseFrequency="0.65" numOctaves="3" stitchTiles="stitch"/></filter><rect width="100%25" height="100%25" filter="url(%23n)" opacity="0.08"/></svg>');
  background-size: 200px 200px;
  animation: ufx-vhsdrift 0.1s steps(2) infinite; pointer-events: none;
}
.ufx-vhs-line {
  position: absolute; left: 0; right: 0; height: 3px;
  background: rgba(255,255,255,.15);
  animation: ufx-vhsline 3s ease-in-out infinite; pointer-events: none;
}
@keyframes ufx-scanroll { from { background-position: 0 0; } to { background-position: 0 600px; } }
@keyframes ufx-vhsdrift { 0% { transform: translateX(0); } 50% { transform: translateX(1px); } 100% { transform: translateX(-1px); } }
@keyframes ufx-vhsline { 0% { top: -5px; opacity: 0; } 10% { opacity: 1; } 90% { opacity: 1; } 100% { top: 105%; opacity: 0; } }

/* ── Night Vision ── */
.ufx-nv-overlay { position: absolute; inset: 0; z-index: 3; pointer-events: none; opacity: 0; transition: opacity .3s; }
.ufx-nv-overlay.active { opacity: 1; }
.ufx-nv-overlay::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, transparent 50%, rgba(0,30,0,.7) 100%);
}
.ufx-nv-overlay::after {
  content: ''; position: absolute; inset: 0;
  background: repeating-linear-gradient(0deg, rgba(0,255,0,.03) 0px, rgba(0,255,0,.03) 1px, transparent 1px, transparent 2px);
}

/* ── Negative / Invert (filter applied via JS) ── */

/* ── Sepia Vintage ── */
.ufx-sepia-overlay { position: absolute; inset: 0; z-index: 3; pointer-events: none; opacity: 0; transition: opacity .3s; }
.ufx-sepia-overlay.active { opacity: 1; }
.ufx-sepia-overlay::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, transparent 40%, rgba(0,0,0,.6) 100%);
}

/* ── Dreamy / Soft Glow ── */
.ufx-dream-overlay { position: absolute; inset: 0; z-index: 3; pointer-events: none; opacity: 0; }
.ufx-dream-overlay.active { opacity: 1; }
.ufx-dream-glow {
  position: absolute; inset: 0; pointer-events: none;
  backdrop-filter: blur(6px) brightness(1.15); -webkit-backdrop-filter: blur(6px) brightness(1.15);
  opacity: 0; animation: ufx-dreampulse 3s ease-in-out infinite;
}
@keyframes ufx-dreampulse { 0%,100% { opacity: 0; } 50% { opacity: .3; } }

/* ── Duotone ── */
.ufx-duotone-overlay { position: absolute; inset: 0; z-index: 3; pointer-events: none; opacity: 0; transition: opacity .3s; }
.ufx-duotone-overlay.active { opacity: 1; background: linear-gradient(135deg, rgba(0,200,255,.4), rgba(255,0,100,.4)); mix-blend-mode: color; }

/* ── Cyberpunk Neon ── */
.ufx-cyberneon-overlay { position: absolute; inset: 0; z-index: 3; pointer-events: none; opacity: 0; transition: opacity .3s; border: 2px solid rgba(0,245,255,.5); box-shadow: inset 0 0 40px rgba(0,245,255,.1), inset 0 0 80px rgba(255,0,100,.05); }
.ufx-cyberneon-overlay.active { opacity: 1; }

/* ── Zoom Pulse ── */
.ufx-zoompulse { animation: ufx-zoompulse 2s ease-in-out infinite; transform-origin: center center; overflow: hidden; }
@keyframes ufx-zoompulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.06); } }

/* ── Shake ── */
.ufx-shake { animation: ufx-shake 0.15s ease-in-out infinite; }
@keyframes ufx-shake { 0% { transform: translate(0,0); } 25% { transform: translate(-3px,2px); } 50% { transform: translate(2px,-3px); } 75% { transform: translate(-2px,1px); } 100% { transform: translate(0,0); } }

/* ── Psychedelic (hue cycle — driven by JS for compound filter compat) ── */

/* ── Mirror (transform applied via JS) ── */

/* ── Cinema Letterbox ── */
.ufx-cinema-overlay { position: absolute; inset: 0; z-index: 3; pointer-events: none; opacity: 0; transition: opacity .3s; }
.ufx-cinema-overlay.active { opacity: 1; }
.ufx-cinema-bar { position: absolute; left: 0; right: 0; height: 14%; background: #000; pointer-events: none; }
.ufx-cinema-bar.top { top: 0; }
.ufx-cinema-bar.bottom { bottom: 0; }

/* ── Thermal ── */
.ufx-thermal-overlay { position: absolute; inset: 0; z-index: 3; pointer-events: none; opacity: 0; transition: opacity .3s; }
.ufx-thermal-overlay.active { opacity: 1; background: linear-gradient(180deg, rgba(255,0,0,.3) 0%, rgba(255,165,0,.2) 30%, rgba(255,255,0,.15) 50%, rgba(0,200,0,.15) 70%, rgba(0,0,255,.25) 100%); mix-blend-mode: color; }

/* ── Spotlight ── */
.ufx-spotlight-overlay { position: absolute; inset: 0; z-index: 3; pointer-events: none; opacity: 0; transition: opacity .3s; }
.ufx-spotlight-overlay.active { opacity: 1; background: radial-gradient(circle 120px at var(--sx, 50%) var(--sy, 50%), transparent 0%, rgba(0,0,0,.85) 100%); }

/* ═══════════ USER FX PICKER PANEL ═══════════ */
.ufx-panel { position: fixed; inset: 0; z-index: 800; display: none; }
.ufx-panel.open { display: flex; flex-direction: column; justify-content: flex-end; }
.ufx-panel-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.45); }
.ufx-sheet {
  position: relative; z-index: 1;
  background: var(--cat-sheet-bg, rgba(12,18,30,.97));
  border-top: 1px solid rgba(0,245,255,.15);
  border-radius: 18px 18px 0 0;
  padding: 14px 16px 20px;
  max-height: 55dvh; overflow-y: auto;
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
}
.ufx-sheet-title { font-size: .88rem; color: var(--menu-accent, #00f5ff); font-weight: 600; margin-bottom: 10px; text-align: center; }
.ufx-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
}
.ufx-item {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 8px 2px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 10px;
  background: rgba(255,255,255,.03);
  cursor: pointer;
  transition: background .15s, border-color .15s;
  user-select: none; -webkit-user-select: none;
}
.ufx-item:hover { background: rgba(0,245,255,.06); }
.ufx-item.active { border-color: var(--menu-accent, #00f5ff); background: rgba(0,245,255,.12); }
.ufx-item.active .ufx-icon { color: var(--menu-accent, #00f5ff); }
.ufx-icon { width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; color: rgba(255,255,255,.7); }
.ufx-label { font-size: .62rem; color: rgba(255,255,255,.55); text-align: center; line-height: 1.15; }
.ufx-item.active .ufx-label { color: var(--menu-accent, #00f5ff); }
/* Dark theme */
body.theme-dark .ufx-sheet { background: rgba(22,27,34,.97); border-color: #30363d; }
body.theme-dark .ufx-sheet-title { color: #58a6ff; }
body.theme-dark .ufx-item.active { border-color: #58a6ff; background: rgba(88,166,255,.12); }
body.theme-dark .ufx-item.active .ufx-icon,
body.theme-dark .ufx-item.active .ufx-label { color: #58a6ff; }
/* Grey theme */
body.theme-grey .ufx-sheet { background: #1e1e1e; border-color: #3c3c3c; }
body.theme-grey .ufx-sheet-title { color: #007acc; }
body.theme-grey .ufx-item.active { border-color: #007acc; background: rgba(0,122,204,.12); }
body.theme-grey .ufx-item.active .ufx-icon,
body.theme-grey .ufx-item.active .ufx-label { color: #007acc; }
/* White theme */
body.theme-white .ufx-sheet { background: rgba(255,255,255,.96); border-color: rgba(140,170,210,.4); }
body.theme-white .ufx-sheet-title { color: #0078d4; }
body.theme-white .ufx-item { border-color: rgba(0,0,0,.08); }
body.theme-white .ufx-item.active { border-color: #0078d4; background: rgba(0,120,212,.08); }
body.theme-white .ufx-icon { color: #333; }
body.theme-white .ufx-label { color: #555; }
body.theme-white .ufx-item.active .ufx-icon,
body.theme-white .ufx-item.active .ufx-label { color: #0078d4; }
/* Glitch button active count badge */
.shorts-glitch-btn .ufx-count {
  position: absolute; top: -4px; right: -4px;
  background: var(--menu-accent, #00f5ff);
  color: #000; font-size: .55rem; font-weight: 700;
  min-width: 14px; height: 14px; line-height: 14px;
  text-align: center; border-radius: 7px; padding: 0 3px;
  display: none;
}
.shorts-glitch-btn .ufx-count.visible { display: block; }
body.theme-dark .shorts-glitch-btn .ufx-count { background: #58a6ff; color: #0d1117; }
body.theme-grey .shorts-glitch-btn .ufx-count { background: #007acc; color: #fff; }
body.theme-white .shorts-glitch-btn .ufx-count { background: #0078d4; color: #fff; }

/* ═══════════ FX EDITOR VIDEO PREVIEW (admin) ═══════════ */
.fx-preview-wrap {
  position: relative; width: 100%; max-height: 220px; aspect-ratio: 9/16;
  border-radius: 10px; overflow: hidden; background: #000; margin-bottom: 4px;
}
.fx-preview-wrap video { width: 100%; height: 100%; object-fit: cover; display: block; }
.fx-preview-wrap .disco-laser-container { z-index: 2; }
