/* ==========================================================================
   Needle on the Sketch — Production Enhancements (Phase 2)
   --------------------------------------------------------------------------
   This stylesheet is additive and opt-in. It introduces a consolidated design
   token layer, a handful of new surfaces (mini-player, command palette, tip
   jar, creator studio, toasts with undo, skeletons, etc.), and a number of
   corrections for contrast, focus visibility, and light-theme parity.

   Loaded after styles.css so later rules win where names intentionally
   overlap. Nothing in here should need !important except for the clearly
   marked override section at the bottom.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design tokens (NoS-v2) — consistent spacing, elevation, radius, motion
   -------------------------------------------------------------------------- */
:root {
    /* Spacing scale (4px base) */
    --nos-space-1: 4px;
    --nos-space-2: 8px;
    --nos-space-3: 12px;
    --nos-space-4: 16px;
    --nos-space-5: 20px;
    --nos-space-6: 24px;
    --nos-space-8: 32px;
    --nos-space-10: 40px;
    --nos-space-12: 48px;

    /* Radius scale */
    --nos-radius-xs: 4px;
    --nos-radius-sm: 6px;
    --nos-radius-md: 10px;
    --nos-radius-lg: 14px;
    --nos-radius-xl: 20px;
    --nos-radius-pill: 999px;

    /* Motion */
    --nos-ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --nos-ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --nos-duration-fast: 160ms;
    --nos-duration-base: 240ms;
    --nos-duration-slow: 400ms;

    /* Surfaces */
    --nos-surface-1: rgba(255, 255, 255, 0.03);
    --nos-surface-2: rgba(255, 255, 255, 0.06);
    --nos-surface-3: rgba(255, 255, 255, 0.09);
    --nos-surface-4: rgba(255, 255, 255, 0.12);
    --nos-border-subtle: rgba(255, 255, 255, 0.08);
    --nos-border-strong: rgba(255, 255, 255, 0.16);

    /* Semantic accents (independent of the ambient yellow brand) */
    --nos-accent: #ffd700;
    --nos-accent-soft: rgba(255, 215, 0, 0.12);
    --nos-success: #22c55e;
    --nos-danger: #ef4444;
    --nos-warning: #f59e0b;
    --nos-info: #3b82f6;

    /* Focus ring — accessible and visible on any background */
    --nos-focus-ring: 0 0 0 2px var(--primary-black, #0a0a0a),
                      0 0 0 4px var(--nos-accent);

    /* Z-layers */
    --nos-z-sticky: 50;
    --nos-z-miniplayer: 900;
    --nos-z-dropdown: 950;
    --nos-z-palette: 1000;
    --nos-z-modal: 1050;
    --nos-z-toast: 1100;
    --nos-z-tour: 1200;
}

body.light-theme {
    --nos-surface-1: rgba(0, 0, 0, 0.02);
    --nos-surface-2: rgba(0, 0, 0, 0.04);
    --nos-surface-3: rgba(0, 0, 0, 0.06);
    --nos-surface-4: rgba(0, 0, 0, 0.08);
    --nos-border-subtle: rgba(0, 0, 0, 0.08);
    --nos-border-strong: rgba(0, 0, 0, 0.16);
    --nos-accent-soft: rgba(230, 170, 0, 0.14);
}

/* --------------------------------------------------------------------------
   2. Global corrections — focus, contrast, reduced motion
   -------------------------------------------------------------------------- */

/* Accessible focus ring on every focusable element */
:is(button, a, [role="button"], input, textarea, select, [tabindex]):focus-visible {
    outline: none;
    box-shadow: var(--nos-focus-ring);
    border-radius: var(--nos-radius-sm);
}

/* Light-theme readability fixes (the existing file sets several colors that
   stay white-on-white in light mode) */
body.light-theme .nos-surface,
body.light-theme .nos-panel {
    background: #ffffff;
    color: #1a1a1a;
}

body.light-theme .hero-subtitle,
body.light-theme .section-subtitle,
body.light-theme .splash-section-subtitle {
    color: #4a4a4a;
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Prevent layout shift on async image loads in video cards */
.video-thumbnail img,
.video-thumbnail-img {
    background: linear-gradient(110deg,
        rgba(255, 255, 255, 0.04) 8%,
        rgba(255, 255, 255, 0.08) 18%,
        rgba(255, 255, 255, 0.04) 33%);
    background-size: 200% 100%;
}

/* --------------------------------------------------------------------------
   3. Skeleton loaders — replace raw spinners with shaped placeholders
   -------------------------------------------------------------------------- */
.nos-skeleton-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: var(--nos-space-5);
}
.nos-skeleton-card {
    display: flex;
    flex-direction: column;
    gap: var(--nos-space-3);
}
.nos-skeleton {
    background: linear-gradient(90deg,
        var(--nos-surface-2) 0%,
        var(--nos-surface-3) 50%,
        var(--nos-surface-2) 100%);
    background-size: 200% 100%;
    animation: nos-shimmer 1.2s ease-in-out infinite;
    border-radius: var(--nos-radius-md);
}
.nos-skeleton-thumb { aspect-ratio: 16 / 9; width: 100%; }
.nos-skeleton-line { height: 12px; border-radius: var(--nos-radius-xs); }
.nos-skeleton-line.short { width: 60%; }
.nos-skeleton-line.medium { width: 80%; }
.nos-skeleton-circle { width: 36px; height: 36px; border-radius: 50%; }
.nos-skeleton-row {
    display: flex;
    gap: var(--nos-space-3);
    align-items: center;
}
.nos-skeleton-row .nos-skeleton-lines {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--nos-space-2);
}
@keyframes nos-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* --------------------------------------------------------------------------
   4. Command palette (⌘K / Ctrl+K)
   -------------------------------------------------------------------------- */
.nos-palette-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: var(--nos-z-palette);
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding-top: 12vh;
    animation: nos-fade-in var(--nos-duration-fast) var(--nos-ease-out);
}
.nos-palette-backdrop.open { display: flex; }

.nos-palette {
    width: min(640px, calc(100vw - 32px));
    max-height: 70vh;
    background: var(--secondary-black, #1a1a1a);
    border: 1px solid var(--nos-border-strong);
    border-radius: var(--nos-radius-lg);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6),
                0 0 0 1px rgba(255, 215, 0, 0.05);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: nos-pop-in var(--nos-duration-base) var(--nos-ease-spring);
}
body.light-theme .nos-palette {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.2);
}
.nos-palette-header {
    display: flex;
    align-items: center;
    gap: var(--nos-space-3);
    padding: var(--nos-space-4) var(--nos-space-5);
    border-bottom: 1px solid var(--nos-border-subtle);
}
.nos-palette-header i {
    color: var(--text-secondary);
    font-size: 16px;
}
.nos-palette-input {
    flex: 1;
    background: transparent;
    border: 0;
    outline: 0;
    color: var(--text-primary);
    font-size: 16px;
    padding: 4px 0;
}
.nos-palette-input::placeholder { color: var(--text-muted); }
.nos-palette-kbd {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: var(--nos-radius-xs);
    background: var(--nos-surface-3);
    color: var(--text-secondary);
    border: 1px solid var(--nos-border-subtle);
}
.nos-palette-list {
    overflow-y: auto;
    flex: 1;
    padding: var(--nos-space-2);
}
.nos-palette-group {
    padding: var(--nos-space-2) var(--nos-space-3);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
}
.nos-palette-item {
    display: flex;
    align-items: center;
    gap: var(--nos-space-3);
    padding: var(--nos-space-3) var(--nos-space-4);
    border-radius: var(--nos-radius-md);
    cursor: pointer;
    color: var(--text-primary);
    font-size: 14px;
    transition: background var(--nos-duration-fast) var(--nos-ease-out);
    user-select: none;
}
.nos-palette-item:hover,
.nos-palette-item[aria-selected="true"] {
    background: var(--nos-accent-soft);
}
.nos-palette-item i {
    width: 20px;
    text-align: center;
    color: var(--text-secondary);
}
.nos-palette-item[aria-selected="true"] i { color: var(--nos-accent); }
.nos-palette-item-label { flex: 1; }
.nos-palette-item-hint {
    font-size: 12px;
    color: var(--text-muted);
}
.nos-palette-empty {
    padding: var(--nos-space-8) var(--nos-space-5);
    text-align: center;
    color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   5. Floating mini-player
   -------------------------------------------------------------------------- */
.nos-mini-player {
    position: fixed;
    right: var(--nos-space-5);
    bottom: var(--nos-space-5);
    width: 360px;
    max-width: calc(100vw - 32px);
    background: var(--secondary-black, #1a1a1a);
    border: 1px solid var(--nos-border-strong);
    border-radius: var(--nos-radius-md);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    z-index: var(--nos-z-miniplayer);
    display: none;
    flex-direction: column;
    animation: nos-mini-slide-in var(--nos-duration-base) var(--nos-ease-out);
}
.nos-mini-player.open { display: flex; }
.nos-mini-player-video {
    position: relative;
    aspect-ratio: 16 / 9;
    background: #000;
    cursor: pointer;
}
.nos-mini-player-video img,
.nos-mini-player-video video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.nos-mini-player-play-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.35);
    color: #fff;
    font-size: 36px;
    opacity: 0;
    transition: opacity var(--nos-duration-fast) var(--nos-ease-out);
}
.nos-mini-player-video:hover .nos-mini-player-play-overlay { opacity: 1; }
.nos-mini-player-info {
    padding: var(--nos-space-3) var(--nos-space-4);
    display: flex;
    gap: var(--nos-space-3);
    align-items: center;
    border-top: 1px solid var(--nos-border-subtle);
}
.nos-mini-player-text {
    flex: 1;
    min-width: 0;
}
.nos-mini-player-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0;
}
.nos-mini-player-channel {
    font-size: 11px;
    color: var(--text-secondary);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.nos-mini-player-controls {
    display: flex;
    gap: var(--nos-space-1);
    flex-shrink: 0;
}
.nos-mini-btn {
    background: transparent;
    border: 0;
    color: var(--text-secondary);
    width: 30px;
    height: 30px;
    border-radius: var(--nos-radius-sm);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    transition: all var(--nos-duration-fast) var(--nos-ease-out);
}
.nos-mini-btn:hover {
    background: var(--nos-surface-3);
    color: var(--nos-accent);
}
.nos-mini-player-progress {
    height: 3px;
    background: var(--nos-surface-2);
    position: relative;
}
.nos-mini-player-progress-fill {
    height: 100%;
    background: var(--nos-accent);
    width: 0%;
    transition: width 150ms linear;
}

@keyframes nos-mini-slide-in {
    from { transform: translateY(20px) scale(0.96); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}
@keyframes nos-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes nos-pop-in {
    from { transform: translateY(-12px) scale(0.98); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}

/* --------------------------------------------------------------------------
   6. Theater mode (wide player layout)
   -------------------------------------------------------------------------- */
/* Collapse sidebar + expand main content when theater is on (only on video page) */
body.nos-theater #videoPlayerPage {
    /* Break out of the .main-content padding so the player can be edge-to-edge */
    margin: -30px calc(var(--nos-space-8) * -1) 0;
}
body.nos-theater .sidebar:not(.pinned) {
    transform: translateX(-250px);
}
body.nos-theater .main-content {
    margin-left: 0;
    width: 100%;
}

/* Uncap the player container and collapse the 2-column grid */
body.nos-theater #videoPlayerPage .video-player-container {
    display: block;
    max-width: none;
    margin: 0;
    gap: 0;
}

/* Player wrapper: full width, black background bleed */
body.nos-theater #videoPlayerPage .player-wrapper {
    max-width: none;
    width: 100%;
    margin: 0;
    border-radius: 0;
    background: #000;
    box-shadow: none;
}

/* The video itself: fill viewport minus navbar (60px), keep 16:9 but cap by height */
body.nos-theater #videoPlayerPage .video-player {
    position: relative;
    width: 100%;
    /* Override the aspect-ratio padding from styles.css */
    padding-bottom: 0 !important;
    height: calc(100vh - 60px);
    max-height: calc(100vh - 60px);
    /* Center the 16:9 video inside the black letterbox */
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
}

/* The <video>/<iframe>/.video-js inside absolute-positions to fill — keep that but let it contain properly */
body.nos-theater #videoPlayerPage .video-player .video-js,
body.nos-theater #videoPlayerPage .video-player video,
body.nos-theater #videoPlayerPage .video-player iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Everything below the player: centered, readable width */
body.nos-theater #videoPlayerPage .video-info,
body.nos-theater #videoPlayerPage .comments-section,
body.nos-theater #videoPlayerPage .related-videos {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--nos-space-6);
    padding-right: var(--nos-space-6);
}

body.nos-theater #videoPlayerPage .video-info {
    margin-top: var(--nos-space-6);
}
body.nos-theater #videoPlayerPage .comments-section,
body.nos-theater #videoPlayerPage .related-videos {
    margin-top: var(--nos-space-8);
}

/* Mobile: don't apply theater transforms below 960px — keep normal layout */
@media (max-width: 960px) {
    body.nos-theater #videoPlayerPage {
        margin: 0;
    }
    body.nos-theater #videoPlayerPage .video-player {
        height: auto;
        padding-bottom: 56.25% !important;
        display: block;
    }
    body.nos-theater .sidebar {
        transform: none;
    }
}

/* Theater toggle button icon swap */
.nos-theater-btn .nos-theater-on { display: none; }
body.nos-theater .nos-theater-btn .nos-theater-off { display: none; }
body.nos-theater .nos-theater-btn .nos-theater-on { display: inline; }

/* --------------------------------------------------------------------------
   7. Ambient glow on video player (tasteful, disabled via setting)
   -------------------------------------------------------------------------- */
body.nos-ambient #videoPlayerPage .player-wrapper {
    position: relative;
    z-index: 1;
}
body.nos-ambient #videoPlayerPage .player-wrapper::before {
    content: '';
    position: absolute;
    inset: -20px;
    background: radial-gradient(ellipse at center,
        rgba(255, 215, 0, 0.25) 0%,
        rgba(255, 215, 0, 0.05) 40%,
        transparent 70%);
    filter: blur(60px);
    z-index: -1;
    opacity: 0.7;
    animation: nos-ambient-pulse 8s ease-in-out infinite;
    pointer-events: none;
}
@keyframes nos-ambient-pulse {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.02); }
}

/* --------------------------------------------------------------------------
   8. Tip jar (Support creator)
   -------------------------------------------------------------------------- */
.nos-tip-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: linear-gradient(135deg, #ff4081 0%, #ff8a65 100%);
    color: #fff;
    border: 0;
    border-radius: var(--nos-radius-pill);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all var(--nos-duration-fast) var(--nos-ease-out);
    box-shadow: 0 4px 12px rgba(255, 64, 129, 0.25);
}
.nos-tip-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(255, 64, 129, 0.45);
    color: #fff;
}
.nos-tip-btn i { font-size: 14px; }

.nos-tip-modal .nos-modal-body {
    text-align: center;
}
.nos-tip-amounts {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--nos-space-2);
    margin: var(--nos-space-4) 0;
}
.nos-tip-amount {
    padding: var(--nos-space-4) 0;
    background: var(--nos-surface-2);
    border: 2px solid transparent;
    border-radius: var(--nos-radius-md);
    color: var(--text-primary);
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    transition: all var(--nos-duration-fast) var(--nos-ease-out);
}
.nos-tip-amount:hover {
    background: var(--nos-surface-3);
    transform: translateY(-2px);
}
.nos-tip-amount.selected {
    border-color: var(--nos-accent);
    background: var(--nos-accent-soft);
    color: var(--nos-accent);
}
.nos-tip-custom {
    position: relative;
    margin: var(--nos-space-4) 0;
}
.nos-tip-custom-prefix {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-weight: 700;
}
.nos-tip-custom input {
    width: 100%;
    padding: 12px 12px 12px 28px;
    background: var(--nos-surface-2);
    border: 1px solid var(--nos-border-subtle);
    border-radius: var(--nos-radius-md);
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 600;
}
.nos-tip-message {
    width: 100%;
    padding: 12px;
    background: var(--nos-surface-2);
    border: 1px solid var(--nos-border-subtle);
    border-radius: var(--nos-radius-md);
    color: var(--text-primary);
    font-size: 14px;
    min-height: 72px;
    resize: vertical;
    font-family: inherit;
}
.nos-tip-note {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: var(--nos-space-3);
    line-height: 1.5;
}

/* --------------------------------------------------------------------------
   9. Creator Studio drawer — analytics, earnings, recent content
   -------------------------------------------------------------------------- */
.nos-studio-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: var(--nos-z-modal);
    display: none;
    animation: nos-fade-in var(--nos-duration-fast) var(--nos-ease-out);
}
.nos-studio-overlay.open { display: block; }

.nos-studio-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(640px, 92vw);
    background: var(--secondary-black, #1a1a1a);
    border-left: 1px solid var(--nos-border-strong);
    z-index: calc(var(--nos-z-modal) + 1);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform var(--nos-duration-slow) var(--nos-ease-out);
    box-shadow: -24px 0 64px rgba(0, 0, 0, 0.5);
}
.nos-studio-drawer.open { transform: translateX(0); }
body.light-theme .nos-studio-drawer { background: #ffffff; }

.nos-studio-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--nos-space-5) var(--nos-space-6);
    border-bottom: 1px solid var(--nos-border-subtle);
    flex-shrink: 0;
}
.nos-studio-title {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: var(--nos-space-2);
}
.nos-studio-title i { color: var(--nos-accent); }
.nos-studio-close {
    background: transparent;
    border: 0;
    color: var(--text-secondary);
    font-size: 24px;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: var(--nos-radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background var(--nos-duration-fast) var(--nos-ease-out);
}
.nos-studio-close:hover { background: var(--nos-surface-2); }

.nos-studio-body {
    flex: 1;
    overflow-y: auto;
    padding: var(--nos-space-6);
}
.nos-studio-tabs {
    display: flex;
    gap: var(--nos-space-1);
    margin-bottom: var(--nos-space-5);
    border-bottom: 1px solid var(--nos-border-subtle);
}
.nos-studio-tab {
    padding: var(--nos-space-3) var(--nos-space-4);
    background: transparent;
    border: 0;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
    transition: color var(--nos-duration-fast) var(--nos-ease-out);
}
.nos-studio-tab:hover { color: var(--text-primary); }
.nos-studio-tab.active {
    color: var(--nos-accent);
    border-bottom-color: var(--nos-accent);
}

.nos-studio-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: var(--nos-space-3);
    margin-bottom: var(--nos-space-6);
}
.nos-stat-card {
    padding: var(--nos-space-4);
    background: var(--nos-surface-1);
    border: 1px solid var(--nos-border-subtle);
    border-radius: var(--nos-radius-md);
    position: relative;
    overflow: hidden;
}
.nos-stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--nos-stat-color, var(--nos-accent));
    opacity: 0.8;
}
.nos-stat-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: var(--nos-space-2);
}
.nos-stat-value {
    font-size: 26px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.1;
}
.nos-stat-delta {
    font-size: 12px;
    margin-top: var(--nos-space-2);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--nos-success);
}
.nos-stat-delta.negative { color: var(--nos-danger); }
.nos-stat-delta.flat { color: var(--text-muted); }

/* Sparkline */
.nos-sparkline {
    width: 100%;
    height: 40px;
    margin-top: var(--nos-space-2);
    display: block;
}
.nos-sparkline-path {
    fill: none;
    stroke: var(--nos-stat-color, var(--nos-accent));
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.nos-sparkline-area {
    fill: var(--nos-stat-color, var(--nos-accent));
    opacity: 0.15;
}

/* Studio list rows */
.nos-studio-section {
    margin-bottom: var(--nos-space-6);
}
.nos-studio-section-title {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: var(--nos-space-3);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.nos-studio-list {
    display: flex;
    flex-direction: column;
    gap: var(--nos-space-2);
}
.nos-studio-row {
    display: grid;
    grid-template-columns: 100px 1fr auto;
    gap: var(--nos-space-3);
    padding: var(--nos-space-3);
    background: var(--nos-surface-1);
    border: 1px solid var(--nos-border-subtle);
    border-radius: var(--nos-radius-md);
    align-items: center;
}
.nos-studio-row-thumb {
    aspect-ratio: 16 / 9;
    width: 100%;
    border-radius: var(--nos-radius-sm);
    overflow: hidden;
    background: #000;
    display: block;
}
.nos-studio-row-thumb img { width: 100%; height: 100%; object-fit: cover; }
.nos-studio-row-info h4 {
    font-size: 14px;
    margin: 0 0 4px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.nos-studio-row-info p {
    font-size: 12px;
    color: var(--text-muted);
    margin: 0;
    display: flex;
    gap: var(--nos-space-3);
    flex-wrap: wrap;
}
.nos-studio-row-info p span i { margin-right: 3px; }

.nos-studio-empty {
    text-align: center;
    padding: var(--nos-space-10);
    color: var(--text-muted);
}
.nos-studio-empty i {
    font-size: 36px;
    margin-bottom: var(--nos-space-3);
    opacity: 0.4;
}

/* Earnings bar chart */
.nos-earnings-chart {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 140px;
    padding: var(--nos-space-3);
    background: var(--nos-surface-1);
    border: 1px solid var(--nos-border-subtle);
    border-radius: var(--nos-radius-md);
    margin-bottom: var(--nos-space-4);
}
.nos-earnings-bar {
    flex: 1;
    background: linear-gradient(180deg, var(--nos-accent) 0%, rgba(255, 215, 0, 0.4) 100%);
    border-radius: var(--nos-radius-xs) var(--nos-radius-xs) 0 0;
    min-height: 2px;
    position: relative;
    transition: transform var(--nos-duration-fast) var(--nos-ease-out);
    cursor: pointer;
}
.nos-earnings-bar:hover {
    transform: scaleY(1.05);
    transform-origin: bottom;
}
.nos-earnings-bar-tooltip {
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary-black);
    color: var(--text-primary);
    padding: 4px 8px;
    border-radius: var(--nos-radius-xs);
    font-size: 11px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--nos-duration-fast) var(--nos-ease-out);
    z-index: 2;
}
.nos-earnings-bar:hover .nos-earnings-bar-tooltip { opacity: 1; }

/* --------------------------------------------------------------------------
   10. Toast v2 — rich toasts with undo, action buttons, stacking
   -------------------------------------------------------------------------- */
.nos-toast-container {
    position: fixed;
    bottom: var(--nos-space-5);
    left: 50%;
    transform: translateX(-50%);
    z-index: var(--nos-z-toast);
    display: flex;
    flex-direction: column-reverse;
    gap: var(--nos-space-2);
    pointer-events: none;
    max-width: calc(100vw - 32px);
}
.nos-toast {
    display: flex;
    align-items: center;
    gap: var(--nos-space-3);
    min-width: 280px;
    max-width: 420px;
    padding: var(--nos-space-3) var(--nos-space-4);
    background: var(--secondary-black, #1a1a1a);
    border: 1px solid var(--nos-border-strong);
    border-left: 4px solid var(--nos-info);
    border-radius: var(--nos-radius-md);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    color: var(--text-primary);
    pointer-events: auto;
    animation: nos-toast-in var(--nos-duration-base) var(--nos-ease-spring);
    font-size: 14px;
}
.nos-toast.exiting { animation: nos-toast-out var(--nos-duration-fast) var(--nos-ease-out) forwards; }
.nos-toast.nos-toast-success { border-left-color: var(--nos-success); }
.nos-toast.nos-toast-error { border-left-color: var(--nos-danger); }
.nos-toast.nos-toast-warning { border-left-color: var(--nos-warning); }
.nos-toast-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    flex-shrink: 0;
    color: var(--primary-black);
    background: var(--nos-info);
}
.nos-toast-success .nos-toast-icon { background: var(--nos-success); }
.nos-toast-error .nos-toast-icon { background: var(--nos-danger); }
.nos-toast-warning .nos-toast-icon { background: var(--nos-warning); }
.nos-toast-message { flex: 1; }
.nos-toast-action {
    background: transparent;
    border: 1px solid var(--nos-border-subtle);
    color: var(--nos-accent);
    padding: 4px 10px;
    border-radius: var(--nos-radius-sm);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    transition: all var(--nos-duration-fast) var(--nos-ease-out);
    flex-shrink: 0;
}
.nos-toast-action:hover {
    background: var(--nos-accent-soft);
    border-color: var(--nos-accent);
}
.nos-toast-close {
    background: transparent;
    border: 0;
    color: var(--text-muted);
    cursor: pointer;
    width: 20px;
    height: 20px;
    padding: 0;
    font-size: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--nos-radius-xs);
    flex-shrink: 0;
}
.nos-toast-close:hover { color: var(--text-primary); background: var(--nos-surface-2); }

body.light-theme .nos-toast {
    background: #ffffff;
    color: #1a1a1a;
    border-color: rgba(0, 0, 0, 0.12);
}

@keyframes nos-toast-in {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
@keyframes nos-toast-out {
    to { transform: translateY(20px); opacity: 0; }
}

/* --------------------------------------------------------------------------
   11. Video card bookmarking / quick actions (additive, non-conflicting)
   -------------------------------------------------------------------------- */
.nos-quick-actions {
    position: absolute;
    top: 8px;
    left: 8px;
    display: flex;
    gap: 4px;
    opacity: 0;
    transform: translateY(-4px);
    transition: all var(--nos-duration-base) var(--nos-ease-out);
    z-index: 2;
    pointer-events: none;
}
.video-card:hover .nos-quick-actions {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}
.nos-quick-btn {
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.72);
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: all var(--nos-duration-fast) var(--nos-ease-out);
    font-size: 12px;
}
.nos-quick-btn:hover {
    background: var(--nos-accent);
    color: var(--primary-black);
    transform: scale(1.1);
}
.nos-quick-btn.active {
    background: var(--nos-accent);
    color: var(--primary-black);
}

/* --------------------------------------------------------------------------
   12. Keyboard shortcuts cheatsheet modal
   -------------------------------------------------------------------------- */
.nos-shortcut-group {
    margin-bottom: var(--nos-space-5);
}
.nos-shortcut-group-title {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--nos-accent);
    font-weight: 700;
    margin-bottom: var(--nos-space-2);
    padding-bottom: var(--nos-space-2);
    border-bottom: 1px solid var(--nos-border-subtle);
}
.nos-shortcut-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--nos-space-2) 0;
    font-size: 14px;
}
.nos-shortcut-label { color: var(--text-primary); }
.nos-shortcut-keys {
    display: flex;
    gap: 4px;
    align-items: center;
}
.nos-kbd {
    display: inline-block;
    padding: 3px 8px;
    border-radius: var(--nos-radius-xs);
    background: var(--nos-surface-3);
    border: 1px solid var(--nos-border-subtle);
    border-bottom-width: 2px;
    color: var(--text-primary);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 12px;
    min-width: 24px;
    text-align: center;
    line-height: 1.2;
}

/* --------------------------------------------------------------------------
   13. Contextual empty states
   -------------------------------------------------------------------------- */
.nos-empty {
    text-align: center;
    padding: var(--nos-space-12) var(--nos-space-6);
    max-width: 480px;
    margin: 0 auto;
    color: var(--text-secondary);
}
.nos-empty-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto var(--nos-space-4);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--nos-accent-soft);
    color: var(--nos-accent);
    font-size: 30px;
}
.nos-empty-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 var(--nos-space-2);
}
.nos-empty-desc {
    font-size: 14px;
    line-height: 1.6;
    margin: 0 0 var(--nos-space-5);
}
.nos-empty-actions {
    display: inline-flex;
    gap: var(--nos-space-2);
    flex-wrap: wrap;
    justify-content: center;
}

/* --------------------------------------------------------------------------
   14. Onboarding spotlight tour
   -------------------------------------------------------------------------- */
.nos-tour-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    z-index: var(--nos-z-tour);
    display: none;
    pointer-events: auto;
    animation: nos-fade-in var(--nos-duration-base) var(--nos-ease-out);
}
.nos-tour-backdrop.open { display: block; }
.nos-tour-highlight {
    position: absolute;
    border: 2px solid var(--nos-accent);
    border-radius: var(--nos-radius-md);
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.6),
                0 0 30px rgba(255, 215, 0, 0.5);
    transition: all var(--nos-duration-slow) var(--nos-ease-out);
    pointer-events: none;
}
.nos-tour-popover {
    position: absolute;
    background: var(--secondary-black, #1a1a1a);
    border: 1px solid var(--nos-border-strong);
    border-radius: var(--nos-radius-md);
    padding: var(--nos-space-4);
    max-width: 320px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
    pointer-events: auto;
    animation: nos-pop-in var(--nos-duration-base) var(--nos-ease-spring);
}
body.light-theme .nos-tour-popover { background: #ffffff; }
.nos-tour-popover h4 {
    margin: 0 0 var(--nos-space-2);
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: var(--nos-space-2);
}
.nos-tour-popover p {
    margin: 0 0 var(--nos-space-3);
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.5;
}
.nos-tour-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--nos-space-2);
}
.nos-tour-progress {
    display: flex;
    gap: 4px;
}
.nos-tour-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--nos-surface-3);
}
.nos-tour-dot.active {
    background: var(--nos-accent);
    width: 18px;
    border-radius: 3px;
}
.nos-tour-buttons {
    display: flex;
    gap: var(--nos-space-2);
}
.nos-tour-btn {
    background: transparent;
    border: 1px solid var(--nos-border-subtle);
    color: var(--text-primary);
    padding: 5px 12px;
    border-radius: var(--nos-radius-sm);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--nos-duration-fast) var(--nos-ease-out);
}
.nos-tour-btn.primary {
    background: var(--nos-accent);
    color: var(--primary-black);
    border-color: var(--nos-accent);
}
.nos-tour-btn:hover { background: var(--nos-surface-2); }
.nos-tour-btn.primary:hover { background: #ffe033; }

/* --------------------------------------------------------------------------
   15. Offline indicator
   -------------------------------------------------------------------------- */
.nos-offline-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    color: #fff;
    text-align: center;
    padding: 8px;
    font-size: 13px;
    font-weight: 600;
    z-index: calc(var(--nos-z-toast) + 1);
    display: none;
    animation: nos-fade-in var(--nos-duration-base) var(--nos-ease-out);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}
.nos-offline-banner.visible { display: block; }
.nos-offline-banner i { margin-right: 6px; }

/* --------------------------------------------------------------------------
   16. Tip/FYI tooltip ring on info buttons
   -------------------------------------------------------------------------- */
.nos-info-hint {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--nos-surface-3);
    color: var(--text-secondary);
    font-size: 10px;
    cursor: help;
    margin-left: 6px;
    transition: all var(--nos-duration-fast) var(--nos-ease-out);
}
.nos-info-hint:hover {
    background: var(--nos-accent-soft);
    color: var(--nos-accent);
}

/* --------------------------------------------------------------------------
   17. Watch party / presence indicators
   -------------------------------------------------------------------------- */
.nos-presence-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: var(--nos-radius-pill);
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid rgba(34, 197, 94, 0.35);
    color: var(--nos-success);
    font-size: 11px;
    font-weight: 600;
}
.nos-presence-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--nos-success);
    animation: nos-pulse 2s ease-in-out infinite;
}
@keyframes nos-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.85); }
}

/* --------------------------------------------------------------------------
   18. Progress ring for upload/processing states
   -------------------------------------------------------------------------- */
.nos-progress-ring {
    display: inline-block;
    width: 40px;
    height: 40px;
    position: relative;
}
.nos-progress-ring svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}
.nos-progress-ring-bg {
    fill: none;
    stroke: var(--nos-surface-3);
    stroke-width: 4;
}
.nos-progress-ring-fill {
    fill: none;
    stroke: var(--nos-accent);
    stroke-width: 4;
    stroke-linecap: round;
    transition: stroke-dashoffset var(--nos-duration-slow) var(--nos-ease-out);
}
.nos-progress-ring-text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    color: var(--text-primary);
}

/* --------------------------------------------------------------------------
   19. Responsive helpers
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
    .nos-mini-player { width: calc(100vw - 32px); right: 16px; bottom: 72px; }
    .nos-studio-drawer { width: 100vw; }
    .nos-palette-backdrop { padding-top: 8vh; }
    .nos-palette { width: calc(100vw - 32px); }
    .nos-tip-amounts { grid-template-columns: repeat(2, 1fr); }
    .nos-studio-row { grid-template-columns: 80px 1fr; grid-template-rows: auto auto; }
    .nos-studio-row-thumb { grid-row: span 2; }
}

/* --------------------------------------------------------------------------
   20. Accessibility corrections & user preferences
   -------------------------------------------------------------------------- */
.nos-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Compact density user pref */
body.nos-density-compact .video-card { font-size: 13px; }
body.nos-density-compact .video-grid { gap: var(--nos-space-3); }
body.nos-density-compact .content-section { padding: var(--nos-space-4); }
body.nos-density-compact .nav-container { padding: 6px var(--nos-space-4); }

/* High contrast user pref */
body.nos-high-contrast {
    --text-secondary: #d0d0d0;
    --text-muted: #a0a0a0;
    --border-color: #505050;
    --nos-border-subtle: rgba(255, 255, 255, 0.25);
    --nos-border-strong: rgba(255, 255, 255, 0.4);
}
body.nos-high-contrast.light-theme {
    --text-secondary: #2a2a2a;
    --text-muted: #4a4a4a;
    --border-color: #909090;
}

/* --------------------------------------------------------------------------
   21. Override corrections (use !important judiciously)
   -------------------------------------------------------------------------- */
/* Ensure the existing splash CTA uses our improved focus ring */
.splash-cta-btn:focus-visible { box-shadow: var(--nos-focus-ring) !important; }

/* Expand comment textarea without awkward resize grip */
#commentInput,
.comment-input-wrapper textarea {
    field-sizing: content;
}

/* Tidy up scrollbars in Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--nos-border-strong) transparent;
}

/* ==========================================================================
 * PHASE 2 STYLES
 * ========================================================================== */

/* --------------------------------------------------------------------------
   22. Resume / Continue-watching progress bar on thumbnails
   -------------------------------------------------------------------------- */
.nos-resume-bar {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2;
    pointer-events: none;
}
.nos-resume-bar-fill {
    height: 100%;
    background: var(--nos-accent);
    box-shadow: 0 0 6px rgba(255, 215, 0, 0.5);
}

/* --------------------------------------------------------------------------
   23. Share Sheet
   -------------------------------------------------------------------------- */
.nos-share-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--nos-space-2);
    margin-bottom: var(--nos-space-5);
}
.nos-share-target {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: var(--nos-space-3);
    background: var(--nos-surface-2);
    border: 1px solid var(--nos-border-subtle);
    border-radius: var(--nos-radius-md);
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--nos-duration-fast) var(--nos-ease-out);
    font-size: 12px;
    text-align: center;
}
.nos-share-target:hover {
    background: var(--nos-accent-soft);
    border-color: var(--nos-accent);
    transform: translateY(-2px);
    color: var(--nos-accent);
}
.nos-share-target i { font-size: 22px; }
.nos-share-target span { line-height: 1.3; }
.nos-share-url-box {
    background: var(--nos-surface-1);
    border: 1px solid var(--nos-border-subtle);
    border-radius: var(--nos-radius-md);
    padding: var(--nos-space-3);
}
.nos-share-url-box input[type="text"] {
    flex: 1;
    background: var(--primary-black);
    border: 1px solid var(--nos-border-subtle);
    border-radius: var(--nos-radius-sm);
    color: var(--text-primary);
    padding: 8px 12px;
    font-size: 13px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.nos-share-qr {
    margin-top: var(--nos-space-3);
    padding: var(--nos-space-3);
    background: var(--nos-surface-1);
    border-radius: var(--nos-radius-md);
}
@media (max-width: 480px) {
    .nos-share-grid { grid-template-columns: repeat(2, 1fr); }
}

/* --------------------------------------------------------------------------
   24. Upload drag-and-drop overlay
   -------------------------------------------------------------------------- */
.nos-upload-overlay {
    position: fixed;
    inset: 0;
    z-index: var(--nos-z-modal);
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: none;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    animation: nos-fade-in var(--nos-duration-fast) var(--nos-ease-out);
}
.nos-upload-overlay.open { display: flex; }
.nos-upload-overlay-content {
    text-align: center;
    color: var(--text-primary);
    padding: var(--nos-space-12);
    border: 3px dashed var(--nos-accent);
    border-radius: var(--nos-radius-xl);
    max-width: 600px;
    background: rgba(255, 215, 0, 0.05);
}
.nos-upload-overlay-content i {
    font-size: 64px;
    color: var(--nos-accent);
    margin-bottom: var(--nos-space-4);
    display: block;
    animation: nos-bounce 1s ease-in-out infinite;
}
.nos-upload-overlay-content h2 {
    font-size: 32px;
    font-weight: 700;
    margin: 0 0 var(--nos-space-3);
}
.nos-upload-overlay-content p {
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 1.5;
    margin: 0;
}
@keyframes nos-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}

/* --------------------------------------------------------------------------
   25. Chapters
   -------------------------------------------------------------------------- */
#videoChapters { display: none; }
#videoChapters[data-nos-chapters-done] { display: block; }
.nos-chapter-item {
    display: flex;
    gap: var(--nos-space-3);
    align-items: center;
    padding: var(--nos-space-2) var(--nos-space-3);
    border-radius: var(--nos-radius-sm);
    cursor: pointer;
    transition: background var(--nos-duration-fast) var(--nos-ease-out);
    color: var(--text-primary);
}
.nos-chapter-item:hover,
.nos-chapter-item:focus-visible {
    background: var(--nos-surface-2);
    outline: none;
}
.nos-chapter-time {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 12px;
    color: var(--nos-accent);
    background: var(--nos-accent-soft);
    padding: 2px 8px;
    border-radius: var(--nos-radius-xs);
    flex-shrink: 0;
    min-width: 56px;
    text-align: center;
}
.nos-chapter-title {
    font-size: 14px;
    color: var(--text-primary);
}

/* --------------------------------------------------------------------------
   26. Bulk Actions
   -------------------------------------------------------------------------- */
.nos-bulk-bar {
    position: fixed;
    bottom: var(--nos-space-5);
    left: 50%;
    transform: translateX(-50%) translateY(120%);
    z-index: var(--nos-z-toast);
    background: var(--secondary-black, #1a1a1a);
    border: 1px solid var(--nos-border-strong);
    border-radius: var(--nos-radius-pill);
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: var(--nos-space-3);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
    transition: transform var(--nos-duration-base) var(--nos-ease-spring);
}
.nos-bulk-bar.open { transform: translateX(-50%) translateY(0); }
body.light-theme .nos-bulk-bar { background: #ffffff; }
.nos-bulk-cancel {
    background: transparent;
    border: 0;
    color: var(--text-secondary);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.nos-bulk-cancel:hover { background: var(--nos-surface-2); }
.nos-bulk-count {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    padding: 0 var(--nos-space-2);
}
.nos-bulk-actions { display: flex; gap: 6px; }

body.nos-bulk-mode .video-card {
    cursor: pointer;
    position: relative;
}
body.nos-bulk-mode .video-card .video-thumbnail::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.2);
    z-index: 2;
    pointer-events: none;
    transition: background var(--nos-duration-fast) var(--nos-ease-out);
}
.nos-bulk-checkbox {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    border: 2px solid #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: transparent;
    z-index: 3;
    pointer-events: none;
    transition: all var(--nos-duration-fast) var(--nos-ease-out);
}
.video-card.nos-bulk-selected .nos-bulk-checkbox {
    background: var(--nos-accent);
    color: #000;
    border-color: var(--nos-accent);
}
.video-card.nos-bulk-selected .video-thumbnail::before {
    background: rgba(255, 215, 0, 0.18);
    border: 3px solid var(--nos-accent);
}

/* --------------------------------------------------------------------------
   27. Search recent dropdown
   -------------------------------------------------------------------------- */
.search-suggestions.nos-recent-mode {
    /* The host's existing styles still apply; we just replace contents */
}
.nos-search-recent-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--nos-space-3) var(--nos-space-4);
    border-bottom: 1px solid var(--nos-border-subtle);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    font-weight: 700;
}
.nos-search-recent-header i { margin-right: 6px; }
.nos-search-recent-header .btn-link {
    background: transparent;
    border: 0;
    color: var(--nos-accent);
    cursor: pointer;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.nos-search-recent-item {
    display: flex;
    align-items: center;
    gap: var(--nos-space-3);
    padding: var(--nos-space-3) var(--nos-space-4);
    cursor: pointer;
    transition: background var(--nos-duration-fast) var(--nos-ease-out);
    color: var(--text-primary);
    font-size: 14px;
}
.nos-search-recent-item:hover,
.nos-search-recent-item:focus-visible {
    background: var(--nos-surface-2);
    outline: none;
}
.nos-search-recent-item i { color: var(--text-muted); width: 14px; }
.nos-search-recent-item span { flex: 1; }
.nos-search-recent-remove {
    background: transparent;
    border: 0;
    color: var(--text-muted);
    cursor: pointer;
    width: 22px;
    height: 22px;
    border-radius: var(--nos-radius-xs);
    opacity: 0;
    transition: opacity var(--nos-duration-fast) var(--nos-ease-out);
}
.nos-search-recent-item:hover .nos-search-recent-remove { opacity: 1; }
.nos-search-recent-remove:hover { background: var(--nos-surface-3); color: var(--text-primary); }
.nos-search-recent-empty {
    padding: var(--nos-space-8) var(--nos-space-4);
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

/* --------------------------------------------------------------------------
   28. Comments controls
   -------------------------------------------------------------------------- */
.nos-comments-controls {
    display: flex;
    justify-content: flex-end;
    margin: var(--nos-space-2) 0 var(--nos-space-4);
    gap: var(--nos-space-3);
}
.nos-comments-sort {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    font-size: 13px;
}
.nos-comments-sort i { font-size: 11px; }
.nos-comments-sort select {
    background: var(--nos-surface-2);
    border: 1px solid var(--nos-border-subtle);
    border-radius: var(--nos-radius-sm);
    color: var(--text-primary);
    padding: 4px 10px;
    font-size: 13px;
    cursor: pointer;
}
.nos-comment-hidden { display: none; }
.nos-show-more-replies {
    background: transparent;
    border: 0;
    color: var(--nos-accent);
    cursor: pointer;
    padding: var(--nos-space-2) var(--nos-space-3);
    font-size: 13px;
    font-weight: 600;
    margin-top: var(--nos-space-2);
}
.nos-show-more-replies:hover { text-decoration: underline; }

/* --------------------------------------------------------------------------
   29. Notification filter chips
   -------------------------------------------------------------------------- */
.nos-notif-filters {
    display: flex;
    gap: 6px;
    padding: var(--nos-space-2) var(--nos-space-4);
    border-bottom: 1px solid var(--nos-border-subtle);
}
.nos-notif-filter {
    background: transparent;
    border: 1px solid var(--nos-border-subtle);
    color: var(--text-secondary);
    padding: 4px 12px;
    border-radius: var(--nos-radius-pill);
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all var(--nos-duration-fast) var(--nos-ease-out);
}
.nos-notif-filter:hover { background: var(--nos-surface-2); color: var(--text-primary); }
.nos-notif-filter.active {
    background: var(--nos-accent);
    color: #000;
    border-color: var(--nos-accent);
}

/* --------------------------------------------------------------------------
   30. Channel notification bell
   -------------------------------------------------------------------------- */
.nos-bell-btn {
    background: var(--nos-surface-2);
    border: 1px solid var(--nos-border-subtle);
    color: var(--text-primary);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    cursor: pointer;
    margin-left: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all var(--nos-duration-fast) var(--nos-ease-out);
}
.nos-bell-btn:hover {
    background: var(--nos-accent-soft);
    color: var(--nos-accent);
    border-color: var(--nos-accent);
}
.nos-bell-menu {
    position: fixed;
    background: var(--secondary-black, #1a1a1a);
    border: 1px solid var(--nos-border-strong);
    border-radius: var(--nos-radius-md);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
    padding: 6px;
    z-index: var(--nos-z-dropdown);
    min-width: 240px;
    animation: nos-pop-in var(--nos-duration-base) var(--nos-ease-spring);
}
body.light-theme .nos-bell-menu { background: #ffffff; }
.nos-bell-item {
    display: flex;
    align-items: center;
    gap: var(--nos-space-3);
    padding: 10px 14px;
    border: 0;
    background: transparent;
    border-radius: var(--nos-radius-sm);
    width: 100%;
    text-align: left;
    cursor: pointer;
    color: var(--text-primary);
    transition: background var(--nos-duration-fast) var(--nos-ease-out);
}
.nos-bell-item:hover { background: var(--nos-surface-2); }
.nos-bell-item.active {
    background: var(--nos-accent-soft);
    color: var(--nos-accent);
}
.nos-bell-item i { width: 16px; text-align: center; }
.nos-bell-item small { display: block; color: var(--text-muted); font-size: 11px; }

/* --------------------------------------------------------------------------
   31. Grid keyboard navigation
   -------------------------------------------------------------------------- */
.video-card.nos-grid-focused {
    outline: 3px solid var(--nos-accent);
    outline-offset: 4px;
    border-radius: var(--nos-radius-md);
}

/* --------------------------------------------------------------------------
   32. FAM landing page heroes
   -------------------------------------------------------------------------- */
.nos-fam-hero {
    position: relative;
    padding: var(--nos-space-12) var(--nos-space-8);
    border-radius: var(--nos-radius-xl);
    overflow: hidden;
    margin-bottom: var(--nos-space-8);
    color: #fff;
    box-shadow: var(--shadow-lg, 0 8px 32px rgba(0, 0, 0, 0.4));
    isolation: isolate;
}
.nos-fam-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.35) 100%);
    z-index: 1;
}
.nos-fam-hero::after {
    content: '';
    position: absolute;
    top: -40%;
    right: -10%;
    width: 60%;
    height: 180%;
    background: radial-gradient(ellipse, rgba(255, 255, 255, 0.18) 0%, transparent 60%);
    z-index: 0;
    pointer-events: none;
}
.nos-fam-hero-content {
    position: relative;
    z-index: 2;
    max-width: 700px;
}
.nos-fam-hero-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin-bottom: var(--nos-space-4);
}
.nos-fam-hero-tagline {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-weight: 700;
    opacity: 0.9;
    margin-bottom: var(--nos-space-2);
}
.nos-fam-hero-title {
    font-size: clamp(36px, 6vw, 64px);
    font-weight: 800;
    margin: 0 0 var(--nos-space-3);
    line-height: 1;
    letter-spacing: -0.02em;
}
.nos-fam-hero-blurb {
    font-size: clamp(15px, 2vw, 18px);
    line-height: 1.5;
    margin: 0 0 var(--nos-space-6);
    opacity: 0.95;
    max-width: 560px;
}
.nos-fam-hero-stats {
    display: flex;
    gap: var(--nos-space-6);
    margin-bottom: var(--nos-space-6);
    flex-wrap: wrap;
}
.nos-fam-hero-stat {
    border-left: 2px solid rgba(255, 255, 255, 0.4);
    padding-left: var(--nos-space-3);
}
.nos-fam-hero-stat-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.7;
    margin-bottom: 2px;
}
.nos-fam-hero-stat-value {
    font-size: 14px;
    font-weight: 600;
}
.nos-fam-hero-actions {
    display: flex;
    gap: var(--nos-space-3);
    flex-wrap: wrap;
}
.nos-fam-hero-cta {
    padding: 12px 22px;
    border-radius: var(--nos-radius-pill);
    border: 0;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    transition: all var(--nos-duration-fast) var(--nos-ease-out);
}
.nos-fam-hero-cta.primary {
    background: rgba(255, 255, 255, 0.95);
    color: #000;
}
.nos-fam-hero-cta.primary:hover {
    background: #fff;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}
.nos-fam-hero-cta.secondary {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
}
.nos-fam-hero-cta.secondary:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
}
@media (max-width: 768px) {
    .nos-fam-hero { padding: var(--nos-space-8) var(--nos-space-5); }
    .nos-fam-hero-stats { gap: var(--nos-space-4); }
    .nos-fam-hero-actions { flex-direction: column; align-items: stretch; }
    .nos-fam-hero-cta { width: 100%; }
}

/* --------------------------------------------------------------------------
   33. Mobile polish
   -------------------------------------------------------------------------- */
body.nos-mobile .modal-content,
body.nos-mobile .nos-palette {
    transition: transform var(--nos-duration-fast) var(--nos-ease-out),
                opacity var(--nos-duration-fast) var(--nos-ease-out);
    will-change: transform, opacity;
}
body.nos-mobile .modal-content::before {
    content: '';
    display: block;
    width: 36px;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    margin: 8px auto 12px;
}
