/* Scoped to the immersive home; the existing feed and profiles keep their layout. */
body[data-page="reels"] { --reels-bg: #f5f3fa; --reels-text: #242033; --reels-muted: #625972; --reels-glass: #ffffffbd; --reels-line: #c8bfdb70; }
html[data-theme="dark"] body[data-page="reels"] { --reels-bg: #101014; --reels-text: #fff; --reels-muted: #b7b0c5; --reels-glass: #17141db8; --reels-line: #ffffff25; }
body[data-page="reels"] .app-main { background: var(--reels-bg); padding-bottom: 0; color: var(--reels-text); min-height: 0; }
body[data-page="reels"] .app-main > .page-heading,
body[data-page="reels"] .app-main > .demo-banner { display: none; }
.reels-shell { max-width: 560px; margin: auto; position: relative; }
.reels-heading { position: absolute; inset: 0 0 auto; height: 58px; display: flex; align-items: center; justify-content: space-between; padding: 6px 18px; z-index: 10; background: var(--reels-glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--reels-line); }
.reels-heading h1 { font-size: 18px; font-weight: 750; letter-spacing: -.04em; color: var(--reels-text); }
.reels-heading .reels-feed-link { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-width: 52px; height: 44px; color: #fff; background: #7c3aed; box-shadow: 0 3px 12px #7c3aed35; border: 1px solid #ffffff40; border-radius: 13px; font-size: 10px; font-weight: 700; }
.reels-feed-link .icon { width: 19px; height: 19px; }
.reels-stream { height: calc(100dvh - 128px); min-height: 340px; overflow-y: auto; scroll-snap-type: y mandatory; overscroll-behavior-y: contain; scrollbar-width: none; background: var(--reels-bg); border-radius: 18px; }
.reels-stream::-webkit-scrollbar { display: none; }
.reel-card { height: 100%; width: 100%; position: relative; overflow: hidden; scroll-snap-align: start; scroll-snap-stop: always; isolation: isolate; background: var(--reels-bg); color: #fff; }
.reel-card::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg,#0005,transparent 28%,transparent 44%,#000b 100%); pointer-events: none; z-index: 1; }
.reel-card > video { position: absolute; width: 100%; height: 100%; object-fit: contain; }
.reel-play-surface { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; cursor: pointer; }
.reel-top { position: absolute; top: 72px; left: 18px; right: 18px; display: flex; justify-content: flex-end; align-items: center; gap: 8px; z-index: 3; }
.reel-top button,.reel-badge { border: 1px solid #ffffff40; border-radius: 50%; width: 42px; height: 42px; display: inline-flex; align-items: center; justify-content: center; background: #14121b85; backdrop-filter: blur(12px); color: #fff; }
.reel-top [hidden] { display: none; }
.reel-top .icon { width: 22px; height: 22px; }
.reel-status { position: absolute; left: 50%; top: 45%; transform: translate(-50%,-50%); z-index: 3; pointer-events: none; }
.reel-status:not(:empty) { background: #0008; padding: 18px; border: 1px solid #ffffff30; border-radius: 50%; backdrop-filter: blur(8px); }
.reel-status .icon { width: 32px; height: 32px; color: #fff; }
.reel-status[data-status="loader"] .icon { animation: reel-spin 1s linear infinite; }
@keyframes reel-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .reel-status[data-status="loader"] .icon { animation: none; } }
.reel-caption { position: absolute; bottom: 28px; left: 20px; right: 88px; z-index: 3; text-shadow: 0 1px 5px #0008; }
.reel-author { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; color: #fff; }
.reel-author .avatar { width: 40px; height: 40px; border: 1px solid #ffffff70; }
.reel-author strong { display: block; font-size: 14px; }
.reel-author small { display: block; font-size: 11px; color: #ddd7e7; }
.reel-caption > p { font-size: 13px; line-height: 1.5; max-height: 95px; overflow-y: auto; overflow-wrap: anywhere; margin-bottom: 14px; }
.reel-caption .text-link { color: #d7c5ff; }
.reel-reply { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 8px; border: 1px solid #ffffff50; background: #ffffff12; border-radius: 24px; padding: 10px 14px; font-size: 12px; color: #fff; }
.reel-reply .icon { width: 17px; height: 17px; }
.reel-actions { position: absolute; right: 12px; bottom: 36px; display: flex; flex-direction: column; align-items: center; gap: 16px; z-index: 3; }
.reel-actions > * { color: white; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-width: 48px; min-height: 45px; text-shadow: 0 1px 4px #000; }
.reel-actions .icon { width: 29px; height: 29px; filter: drop-shadow(0 1px 3px #0008); }
.reel-actions small { font-size: 10px; font-weight: 650; }
.reel-actions .is-liked { color: #ff628b; }
.reel-progress { position: absolute; bottom: 8px; left: 14px; width: calc(100% - 28px); height: 12px; z-index: 4; accent-color: #b499ff; cursor: pointer; }
.reels-footer { height: 62px; display: flex; justify-content: space-between; align-items: center; padding: 0 22px; color: var(--reels-muted); font-size: 11px; }
.reels-footer div { display: flex; gap: 8px; }
.reels-footer button { width: 34px; height: 34px; border: 1px solid var(--reels-line); border-radius: 50%; font-size: 18px; color: var(--reels-text); }
.reels-state { min-height: 100%; padding: 80px 24px 40px; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; gap: 18px; scroll-snap-align: start; color: var(--reels-muted); }
.reels-state h3 { color: var(--reels-text); font-weight: 700; font-size: 22px; }
.reels-state p { max-width: 320px; line-height: 1.7; font-size: 14px; }
.reel-comments { overflow-y: auto; max-height: 45dvh; padding: 12px 0; }
.reel-panel form { display: grid; gap: 12px; margin-top: 20px; }
.reel-options { display: grid; gap: 12px; padding-top: 16px; }
.reels-shell :focus-visible { outline: 3px solid #ccb7ff; outline-offset: -3px; }
@media (min-width: 768px) { body[data-page="reels"] .app-main { max-width: 560px; } }
@media (max-width: 767px) {
    body[data-page="reels"] { background: var(--reels-bg); }
    .reels-stream { height: calc(100dvh - 84px - env(safe-area-inset-bottom)); min-height: 220px; border-radius: 0; }
    .reels-footer { display: none; }
    body[data-page="reels"] #mobile-slot > div:first-child { bottom: env(safe-area-inset-bottom, 0px); padding: 8px 10px; }
    .reel-caption { left: 16px; bottom: 28px; }
    .reel-actions { gap: 12px; }
}
@media (max-height: 580px) { .reel-actions { gap: 3px; bottom: 22px; } .reel-actions .icon { width: 22px; height: 22px; } .reel-caption > p { max-height: 40px; } }
