/* Channel Accent Color Variables */
:root {
    --channel-accent: red;   /* Viewed channel - navigation, pocket, channel info */
    --managed-accent: red;   /* Managed channel - owner controls only */
}

/* Base Styles */
html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow: hidden;
    background: black;
    font-family: Arial, sans-serif;
}

/* YouTube player base styles */
#youtube-player {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity 0.3s ease;
}

#youtube-player.disabled-controls {
    pointer-events: none;
}

#youtube-player.disabled-controls iframe {
    pointer-events: none;
}

/* YouTube Player Wrapper for blockers */
.yt-player-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    overflow: hidden;
}

.yt-player-wrapper #youtube-player {
    position: absolute;
    z-index: 1;
}

/* YouTube UI Blockers - black bars that cover controls temporarily */
.yt-blocker {
    position: absolute;
    left: 0;
    right: 0;
    height: 80px;
    background: black;
    z-index: 100;
    transition: transform 0.6s ease-out;
    pointer-events: none;
}

.yt-blocker-top {
    top: 0;
    transform: translateY(0);
}

.yt-blocker-top.hidden {
    transform: translateY(-100%);
}

.yt-blocker-bottom {
    bottom: 0;
    transform: translateY(0);
}

.yt-blocker-bottom.hidden {
    transform: translateY(100%);
}

/* Thinner blockers on mobile landscape */
@media screen and (max-width: 896px) and (orientation: landscape) {
    .yt-blocker,
    .main-blocker,
    .title-blocker,
    .pocket-blocker {
        height: 80px !important;
    }
    .pocket-blocker.pocket-blocker-persistent {
        transition: none !important;
    }

    .bottom-blocker {
        height: 15px !important;
        background: black !important;
    }

    .bottom-blocker::after {
        height: 15px !important;
    }
}

/* Video cover for inventory mode */
/* FAST LOAD: Start visible by default for instant load on root URL */
.video-cover {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: black;
    z-index: 2;
    opacity: 1;
    pointer-events: auto;
    transition: opacity 0.3s ease;
}

/* Hidden state for when video should show through */
.video-cover.hidden {
    opacity: 0;
    pointer-events: none;
}

/* Tap to play fallback - shown when autoplay is blocked */
.tap-to-play {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: black;
    z-index: 5;
    color: rgba(255, 255, 255, 0.5);
    font-family: Arial, sans-serif;
    font-size: 14px;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}

.tap-to-play.visible {
    display: flex;
}

/* ============================================================================
   PAUSE OVERLAY - Bottom bar + instructions on Global channel
   ============================================================================ */

.pause-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 150;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.pause-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* Black bar at bottom to cover YouTube "more videos" UI */
.pause-bottom-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 180px;
    background: black;
    z-index: 151;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease 0.4s; /* delay on hide */
}

.pause-overlay.active .pause-bottom-bar {
    opacity: 1;
    transition: opacity 0s ease 0s; /* instant on show */
}

/* Global channel pause: zoom video instead of bottom bar */
body.global-paused-zoom .pause-bottom-bar {
    display: none !important;
}

body.global-paused-zoom #youtube-player,
body.global-paused-zoom #ubuWebPlayer {
    transform: scale(1.2);
    transition: transform 0.3s ease;
}

body:not(.global-paused-zoom) #youtube-player,
body:not(.global-paused-zoom) #ubuWebPlayer {
    transform: scale(1) translateY(0);
    transition: transform 1.5s ease-out;
}

/* Shop promo in pause bar - positioned within the pause bottom bar */
.pause-shop-promo {
    position: fixed;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 12px;
    color: white;
    font-size: 14px;
    pointer-events: auto;
    z-index: 160;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.8);
    padding: 10px;
    border-radius: 8px;
}

.pause-shop-promo * {
    pointer-events: auto;
}

.pause-shop-text {
    color: rgba(255, 255, 255, 0.7);
}

.pause-shop-link {
    color: white;
    text-decoration: none;
    font-weight: 500;
    cursor: pointer;
}

.pause-shop-link:hover {
    text-decoration: underline;
}

.pause-shop-item {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: white;
    cursor: pointer;
}

.pause-shop-item:hover .pause-shop-title {
    text-decoration: underline;
}

.pause-shop-thumb {
    width: 45px;
    height: 65px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    border-radius: 3px;
    flex-shrink: 0;
}

.pause-shop-info {
    display: flex;
    flex-direction: column;
}

.pause-shop-author {
    font-style: italic;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 2px;
}

.pause-shop-title {
    font-weight: 600;
    color: white;
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

/* Container for multiple shop items in pause promo */
.pause-shop-items {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* Pre-order ships date styling */
.shop-ships-date,
.mobile-shop-ships-date,
.safari-ships-date {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 8px;
    text-align: center;
}

.shop-ships-date em,
.mobile-shop-ships-date em,
.safari-ships-date em {
    font-style: italic;
}

/* Instructions container - only visible on Global channel */
.pause-instructions {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 152;
    display: none;
}

.pause-overlay.with-instructions .pause-instructions {
    display: block;
}

.pause-instructions-content {
    text-align: left;
    color: #ff4444;
}

/* Channel info shown on pause */
.pause-channel-info {
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
    max-width: 400px;
    margin: 0 auto;
    pointer-events: auto;
}

.pause-info-title {
    font-size: 16px;
    font-weight: bold;
    color: white;
    margin-bottom: 12px;
}

.pause-info-bio {
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 16px;
}

.pause-info-details {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 12px;
}

.pause-info-links {
    margin-bottom: 12px;
}

.pause-info-links a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 12px;
    font-weight: bold;
    margin: 0 8px;
    pointer-events: auto;
    cursor: pointer;
}

.pause-info-links a:hover {
    color: white;
    text-decoration: underline;
}

.pause-info-cv {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.4);
    line-height: 1.5;
}

.pause-controls-label {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 20px;
    color: #ff4444;
    text-transform: lowercase;
}

.pause-instructions-diagram {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Desktop keyboard keys */
.pause-key-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pause-key-group {
    display: flex;
    gap: 6px;
}

.pause-key {
    width: 36px;
    height: 36px;
    background: rgba(255, 68, 68, 0.15);
    border: 1px solid #ff4444;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #ff4444;
    font-weight: 500;
}

.pause-key-wide {
    width: auto;
    padding: 0 16px;
    font-size: 12px;
    text-transform: lowercase;
}

.pause-key-label {
    font-size: 13px;
    color: #ff4444;
    min-width: 100px;
    text-align: left;
}

/* Desktop pause - big white arrows centered */
.pause-instructions:has(.pause-instructions-desktop) {
    top: 50% !important;
    bottom: auto !important;
    transform: translate(-50%, -50%) !important;
}

.pause-instructions-desktop {
    text-align: center;
}

.pause-big-arrows {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.pause-big-arrow-row {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.pause-big-arrow {
    color: #ffffff;
    font-size: 60px;
    line-height: 1;
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 2px solid #ffffff;
    border-radius: 10px;
}

.pause-hint-label {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 14px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* Mobile swipe gestures */
.pause-gesture-row {
    display: flex;
    margin-bottom: 12px;
}

.pause-gesture {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

.pause-gesture-icon {
    display: flex;
    gap: 16px;
}

.gesture-arrow {
    font-size: 28px;
    color: #ff4444;
}

.pause-gesture-label {
    font-size: 13px;
    color: #ff4444;
}

.pause-instructions-hint {
    font-size: 11px;
    color: rgba(255, 68, 68, 0.5);
    margin-top: 16px;
}

/* Mobile adjustments */
@media screen and (max-width: 768px) {
    .pause-bottom-bar {
        height: 160px;
    }

    .pause-instructions-title {
        font-size: 24px;
    }

    .pause-instructions-subtitle {
        font-size: 13px;
        margin-bottom: 30px;
    }

    .pause-key {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }

    .pause-key-label {
        font-size: 13px;
    }

    .gesture-arrow {
        font-size: 28px;
    }

    .pause-gesture-label {
        font-size: 13px;
    }
}

/* ============================================================================
   POCKET VIEWING MODE - Content takes over the TV
   ============================================================================ */

.pocket-viewing-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 5; /* Above player, below UI controls */
    background: black;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.pocket-viewing-overlay.active {
    display: flex;
}

.pocket-viewing-content {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto; /* Allow scrolling for tall content */
    position: relative;
}

/* Contributor credit for collab channel pocket items - right side, vertically centered */
.pocket-contributor-credit {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: rgba(255, 255, 255, 0.5);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
    pointer-events: auto;
    z-index: 10;
    text-align: right;
}

.pocket-contributor-credit .credit-label {
    font-size: 11px;
    text-transform: lowercase;
    margin-bottom: 2px;
}

.pocket-contributor-credit .credit-name {
    font-size: 14px;
    margin-bottom: 4px;
}

.pocket-contributor-credit .credit-name a {
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
}

.pocket-contributor-credit .credit-name a:hover {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: underline;
}

.pocket-contributor-credit .credit-date {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.4);
}

/* Text content in pocket viewing */
.pocket-text-content {
    max-width: 800px;
    max-height: 90vh;
    padding: 40px;
    color: #ccc; /* Light text for black background */
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 20px;
    line-height: 1.7;
    overflow-y: auto;
    text-align: left;
}

.pocket-text-content::-webkit-scrollbar {
    width: 4px;
}

.pocket-text-content::-webkit-scrollbar-track {
    background: transparent;
}

.pocket-text-content::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 2px;
}

/* Links in pocket text content */
.pocket-text-content a {
    color: #7ab8ff;
    text-decoration: underline;
    cursor: pointer;
    pointer-events: auto;
}

.pocket-text-content a:hover {
    color: #a8d0ff;
}

.pocket-text-content a:active {
    color: #5a98df;
}

/* Pocket text wrapper for edit mode */
.pocket-text-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Pocket text edit button */
.pocket-text-edit-btn {
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(40, 40, 40, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.7);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s ease, background 0.2s ease;
    z-index: 10;
}

.pocket-text-wrapper:hover .pocket-text-edit-btn {
    opacity: 1;
}

.pocket-text-edit-btn:hover {
    background: rgba(60, 60, 60, 0.95);
    color: white;
}

.pocket-text-edit-btn.editing {
    background: var(--channel-accent, #4a9eff);
    color: white;
    border-color: var(--channel-accent, #4a9eff);
    opacity: 1;
}

/* Pocket text editing state */
.pocket-text-content.pocket-text-editing {
    outline: 2px solid var(--channel-accent, #4a9eff);
    outline-offset: 4px;
    border-radius: 4px;
    cursor: text;
}

.pocket-text-content.pocket-text-editing:focus {
    outline: 2px solid var(--channel-accent, #4a9eff);
}

/* Image content in pocket viewing */
.pocket-image-content {
    max-width: 95vw;
    max-height: 95vh;
    object-fit: contain;
}

/* Image with description layout */
.pocket-image-with-description {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 40px;
    max-width: 95vw;
    max-height: 95vh;
}

.pocket-image-with-description .pocket-image-content {
    max-width: 60vw;
    max-height: 90vh;
    flex-shrink: 0;
}

.pocket-image-description {
    max-width: 300px;
    max-height: 80vh;
    overflow-y: auto;
    color: #ccc;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 18px;
    line-height: 1.7;
    text-align: left;
}

.pocket-image-description::-webkit-scrollbar {
    width: 4px;
}

.pocket-image-description::-webkit-scrollbar-track {
    background: transparent;
}

.pocket-image-description::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
}

/* Mobile: stack image and description vertically */
@media screen and (max-width: 768px) {
    .pocket-image-with-description {
        flex-direction: column;
        gap: 20px;
    }

    .pocket-image-with-description .pocket-image-content {
        max-width: 95vw;
        max-height: 60vh;
    }

    .pocket-image-description {
        max-width: 90vw;
        max-height: 30vh;
        font-size: 16px;
        padding: 0 15px;
    }
}

/* Pocket image wrapper for edit mode */
.pocket-image-wrapper {
    position: relative;
    display: inline-block;
    cursor: pointer;
}

/* Pocket image edit button */
.pocket-image-edit-btn {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(40, 40, 40, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.8);
    padding: 8px 24px;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, background 0.2s ease;
    z-index: 10;
}

.pocket-image-edit-btn.visible {
    opacity: 1;
    pointer-events: auto;
}

.pocket-image-edit-btn:hover {
    background: rgba(60, 60, 60, 0.95);
    color: white;
}

/* Pocket image editor overlay */
.pocket-image-editor-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100000;
}

/* Pocket image editor modal */
.pocket-image-editor {
    background: #1a1a1a;
    border-radius: 12px;
    padding: 24px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.pocket-image-editor h3 {
    margin: 0 0 20px 0;
    color: #fff;
    font-size: 18px;
    font-weight: 500;
}

.pocket-image-editor-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.pocket-image-editor-close:hover {
    color: white;
}

/* Image preview with remove button */
.pocket-image-editor-preview {
    position: relative;
    margin-bottom: 20px;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pocket-image-editor-preview img {
    max-width: 100%;
    max-height: 200px;
    object-fit: contain;
}

.pocket-image-editor-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(220, 50, 50, 0.9);
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.pocket-image-editor-remove:hover {
    background: #e74c3c;
}

/* Editor fields */
.pocket-image-editor-field {
    margin-bottom: 16px;
}

.pocket-image-editor-field label {
    display: block;
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    margin-bottom: 6px;
}

.pocket-image-editor-field input[type="text"],
.pocket-image-editor-field textarea {
    width: 100%;
    padding: 10px 12px;
    background: #2a2a2a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: #fff;
    font-size: 14px;
    box-sizing: border-box;
}

.pocket-image-editor-field input[type="text"]:focus,
.pocket-image-editor-field textarea:focus {
    outline: none;
    border-color: var(--channel-accent, #4a9eff);
}

.pocket-image-editor-field textarea {
    min-height: 80px;
    resize: vertical;
    font-family: Georgia, 'Times New Roman', serif;
    line-height: 1.5;
}

.pocket-image-editor-field input[type="file"] {
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
}

/* Editor action buttons */
.pocket-image-editor-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 20px;
}

.pocket-image-editor-cancel,
.pocket-image-editor-save {
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    border: none;
}

.pocket-image-editor-cancel {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
}

.pocket-image-editor-cancel:hover {
    background: rgba(255, 255, 255, 0.15);
}

.pocket-image-editor-save {
    background: var(--channel-accent, #4a9eff);
    color: white;
}

.pocket-image-editor-save:hover {
    opacity: 0.9;
}

/* Video content in pocket viewing (YouTube) */
.pocket-video-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* Swipe overlay for videos/movies - captures touch events over iframes */
.pocket-video-swipe-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10;
    background: transparent;
}

.pocket-video-player {
    width: 100%;
    height: 100%;
    max-width: 100vw;
    max-height: 100vh;
}

#pocketYouTubePlayerContainer {
    width: 100%;
    height: 100%;
    max-width: 100vw;
    max-height: 100vh;
}

#pocketYouTubePlayerContainer iframe {
    width: 100%;
    height: 100%;
}

/* Movie content in pocket viewing (Dropbox videos) */
.pocket-movie-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: black;
    position: relative;
}

.pocket-movie-player {
    width: 100%;
    height: 100%;
    max-width: 100vw;
    max-height: 100vh;
    object-fit: contain;
}

/* Dropbox embed iframe for MKV/AVI/etc */
.pocket-movie-embed {
    border: none;
    background: black;
}

.pocket-movie-fullscreen-btn {
    position: absolute;
    top: 15px;
    left: 15px;
    width: 44px;
    height: 44px;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.6;
    transition: opacity 0.3s ease;
    z-index: 100;
    pointer-events: auto;
}

.pocket-movie-container:hover .pocket-movie-fullscreen-btn,
.pocket-movie-fullscreen-btn:hover {
    opacity: 1;
}

.pocket-movie-fullscreen-btn:hover {
    background: rgba(0, 0, 0, 0.8);
}

/* Pocket video/movie blockers (black bars that recede) */
.pocket-blocker {
    position: absolute;
    left: 0;
    right: 0;
    height: 80px;
    background: black;
    z-index: 50;
    transition: transform 0.6s ease-out;
    pointer-events: none;
}

.pocket-blocker-top {
    top: 0;
    transform: translateY(0);
    opacity: 1;
}

.pocket-blocker-top.hidden {
    transform: translateY(-100%);
}

.pocket-blocker-bottom {
    bottom: 0;
    transform: translateY(0);
}

.pocket-blocker-bottom.hidden {
    transform: translateY(100%);
}

/* Mobile: reduce pocket blocker height so it doesn't cover grid items */
@media (max-width: 768px) {
    .pocket-blocker {
        height: 50px;
    }
}

/* Main player blockers for cinematic channels */
.main-blocker {
    position: fixed;
    left: 0;
    right: 0;
    height: 80px;
    background: black;
    z-index: 150;
    pointer-events: none;
    opacity: 1;
    transition: transform 0.8s ease-out, opacity 0.8s ease-out;
}

/* Instant appearance - no transition */
.main-blocker.no-transition {
    transition: none !important;
}

/* Make default blockers transparent for cinematic mode */
/* Keep pointer-events to block YouTube UI interaction */
body.cinematic-channel .title-blocker,
body.cinematic-channel .bottom-blocker {
    background: transparent;
}

/* Cinematic mode: hide UI until hover */
body.cinematic-channel .safari-channel-tabs,
body.cinematic-channel .pocket-close-btn {
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

/* Show UI on hover anywhere in the window */
body.cinematic-channel:hover .safari-channel-tabs,
body.cinematic-channel:hover .pocket-close-btn {
    opacity: 1;
    pointer-events: auto;
}

/* Mobile landscape: no blockers — zoom handles YouTube UI */
@media screen and (max-width: 1024px) and (orientation: landscape) {
    .main-blocker,
    .main-blocker-top,
    .main-blocker-bottom,
    .title-blocker,
    .bottom-blocker {
        display: none !important;
    }
}

/* Altcomics on mobile portrait: hide swipe overlay so card swipe works */
@media screen and (max-width: 1024px) and (orientation: portrait) {
    body.altcomics-active .swipe-overlay {
        pointer-events: none !important;
    }
}

/* UbuWeb: never show tabs, even on hover */
body.ubuweb-no-tabs .safari-channel-tabs {
    display: none !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Hide age-daily logo on global channel */
body.global-channel-active.cinematic-channel .age-daily {
    display: none;
}

/* Hide collective canvas & pocket buttons */
.collective-buttons {
    display: none !important;
}

.main-blocker-top {
    top: 0;
    transform: translateY(0);
}

.main-blocker-top.hidden {
    transform: translateY(-100%);
    opacity: 0;
}

.main-blocker-bottom {
    bottom: 0;
    transform: translateY(0);
}

.main-blocker-bottom.hidden {
    transform: translateY(100%);
    opacity: 0;
}

/* Pocket video/movie title overlay - matches episode title styling */
.pocket-media-title {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-size: 120px;
    font-family: 'Times New Roman', Times, serif;
    font-style: italic;
    line-height: 1.2;
    z-index: 60;
    opacity: 1;
    transition: opacity 0.5s ease;
    pointer-events: none;
    max-width: calc(100vw - 200px);
    word-wrap: break-word;
}

.pocket-media-title.hidden,
.pocket-media-channel.hidden,
.pocket-media-via.hidden {
    opacity: 0;
}

/* YouTube channel name in pocket viewing */
.pocket-media-channel {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    z-index: 60;
    opacity: 1;
    transition: opacity 0.5s ease;
    pointer-events: none;
    display: none;
}

/* "via channelname" tag in pocket viewing */
.pocket-media-via {
    position: absolute;
    right: 20px;
    top: calc(50% + 30px);
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
    font-style: italic;
    z-index: 60;
    opacity: 1;
    transition: opacity 0.5s ease;
    pointer-events: none;
}

/* "via channelname" tag in pocket grid */
.pocket-item-via {
    position: absolute;
    bottom: 8px;
    left: 8px;
    right: 8px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 10px;
    font-style: italic;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
    pointer-events: auto;
    z-index: 2;
    cursor: pointer;
}
.pocket-item-via .via-channel-name {
    transition: color 0.15s ease;
}
.pocket-item-via:hover .via-channel-name {
    color: white;
    font-weight: bold;
    font-style: normal;
}

/* Pocket viewing: centered image */
.pocket-viewing-centered {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    position: relative;
}

/* Pocket viewing: "pocketed from channelName" top-right */
.pocket-viewing-from {
    position: fixed;
    top: 20px;
    right: 60px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    z-index: 10;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.9), 0 0 20px rgba(0, 0, 0, 0.7);
    pointer-events: auto;
}
.pocket-viewing-from a {
    color: white;
    text-decoration: none;
}
.pocket-viewing-from a:hover {
    text-decoration: underline;
}

/* Pocket viewing: credit at bottom-right */
.pocket-viewing-credit {
    position: fixed;
    bottom: 100px;
    right: 10px;
    font-size: 14px;
    font-weight: bold;
    color: white;
    opacity: 0.9;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.9), 0 0 20px rgba(0, 0, 0, 0.7);
    z-index: 10;
    pointer-events: none;
    text-align: right;
    max-width: 300px;
}

/* Mobile: smaller title */
@media screen and (max-width: 1024px) {
    .pocket-media-title {
        font-size: 28px;
        top: 60px;
        transform: none;
        max-width: calc(100vw - 120px);
        text-shadow: 0 0 8px rgba(0, 0, 0, 0.8);
    }

    .pocket-media-channel {
        right: 15px;
        top: 60px;
        transform: none;
        font-size: 12px;
    }

    .pocket-media-via {
        right: 15px;
        top: 80px;
        font-size: 11px;
    }
}

/* PDF content in pocket viewing */
.pocket-pdf-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    position: relative;
}

.pocket-pdf-page {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
}

.pocket-pdf-page-number {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    font-family: Georgia, serif;
}

/* PDF page container - clickable area */
.pocket-pdf-page-container {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* Spread containers should fill available space */
.pocket-pdf-spread .pocket-pdf-page-container {
    flex: 1;
    height: 100%;
    min-height: 80vh;
}

/* PDF canvas rendering */
.pocket-pdf-canvas {
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.6);
    background: white;
}

/* Single page view (cover/back cover) */
.pocket-pdf-single .pocket-pdf-canvas {
    max-height: 85vh;
}

/* PDF loading state */
.pocket-pdf-loading {
    color: rgba(255, 255, 255, 0.6);
    font-size: 16px;
    font-family: Georgia, serif;
    font-style: italic;
}

/* Mobile PDF cover view - tap to open */
.pocket-pdf-mobile-cover {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    cursor: pointer;
    padding: 20px;
}

.pocket-pdf-mobile-cover-img {
    max-width: 70vw;
    max-height: 60vh;
    object-fit: contain;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    border-radius: 4px;
}

.pocket-pdf-mobile-cover-placeholder {
    font-size: 120px;
    opacity: 0.6;
}

.pocket-pdf-mobile-cover-label {
    font-family: Arial, sans-serif;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    text-transform: lowercase;
}

/* Pocket PDF card-swipe reader */
.pocket-pdf-reader {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    overflow: hidden;
}
.pocket-pdf-card-stack {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    display: flex; align-items: center; justify-content: center;
}
.pocket-pdf-card {
    position: absolute;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.5);
    touch-action: none;
    will-change: transform;
    user-select: none; -webkit-user-select: none;
}
.pocket-pdf-card canvas { display: block; border-radius: 4px; }
.pocket-pdf-card.under {
    transform: scale(0.96) translateY(8px);
    pointer-events: none;
    box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}
.pocket-pdf-animating {
    transition: transform 0.4s ease-out, opacity 0.4s ease-out;
}
.pocket-pdf-progress {
    position: absolute; bottom: 0; left: 0; right: 0; height: 3px;
    background: rgba(255,255,255,0.08);
}
.pocket-pdf-progress-fill {
    height: 100%; background: rgba(255,255,255,0.3);
    transition: width 0.3s ease;
}
.pocket-pdf-page-counter {
    position: absolute; bottom: 20px; left: 20px;
    font-size: 14px; color: #fff;
    text-shadow: 0 1px 6px rgba(0,0,0,0.8), 0 0 20px rgba(0,0,0,0.5);
    pointer-events: none;
    opacity: 0; transition: opacity 0.2s ease;
    z-index: 10;
    user-select: none; -webkit-user-select: none;
    font-family: Georgia, serif;
}
.pocket-pdf-page-counter.visible { opacity: 1; }
.pocket-pdf-card.pocket-pdf-cover-mode {
    cursor: pointer;
    box-shadow: 0 8px 40px rgba(0,0,0,0.6);
}

/* Two-page spread container */
.pocket-pdf-spread {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    flex-direction: row;
}

.pocket-pdf-spread-view {
    flex-direction: column;
}

.pocket-pdf-spread canvas {
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
    background: white;
}

/* Left and right page click areas */
.pocket-pdf-left,
.pocket-pdf-right {
    position: relative;
}

.pocket-pdf-left::after,
.pocket-pdf-right::after {
    content: '';
    position: absolute;
    top: 0;
    width: 50%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.pocket-pdf-left::after {
    left: 0;
}

.pocket-pdf-right::after {
    right: 0;
}

/* Mobile PDF: scrollable container with all pages */
.pocket-pdf-mobile-container {
    width: 100%;
    height: 100%;
    overflow: hidden;
    position: relative;
    touch-action: pan-y pinch-zoom;
}

.pocket-pdf-mobile-scroll {
    width: 100%;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 20px 0 100px 0;
    -webkit-overflow-scrolling: touch;
    transform-origin: top center;
}

.pocket-pdf-canvas-mobile {
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    background: white;
    flex-shrink: 0;
}

/* Desktop PDF: scrollable spreads container */
.pocket-pdf-desktop-container {
    width: 100%;
    height: 100%;
    overflow: hidden;
    position: relative;
}

/* PDF display mode toggle button */
.pdf-display-toggle {
    position: absolute;
    top: 10px;
    right: 20px;
    z-index: 100;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.pdf-display-toggle:hover {
    background: rgba(0, 0, 0, 0.9);
    border-color: rgba(255, 255, 255, 0.5);
}

/* Single page mode: center pages properly */
.pocket-pdf-single-mode .pocket-pdf-single-page {
    justify-content: center;
}

.pocket-pdf-desktop-scroll {
    width: 100%;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 60px;
    padding: 40px 0 100px 0;
}

.pocket-pdf-desktop-spread {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
}

.pocket-pdf-desktop-spread .pocket-pdf-spread {
    display: flex;
    gap: 4px;
}

.pocket-pdf-desktop-spread .pocket-pdf-single-page {
    display: flex;
    justify-content: center;
}

.pocket-pdf-canvas-desktop {
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    background: white;
}

/* Mobile: hide desktop spread view */
@media screen and (max-width: 768px) {
    .pocket-pdf-spread {
        display: none;
    }

    .pocket-pdf-single {
        display: none;
    }
}

/* Side arrows for skipping pocket items */
.pocket-skip-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 20;
    opacity: 0.3;
    transition: opacity 0.2s ease;
    color: white;
    font-size: 24px;
}

.pocket-skip-arrow:hover {
    opacity: 0.8;
}

.pocket-skip-prev {
    left: 10px;
}

.pocket-skip-next {
    right: 10px;
}

/* Hide arrows when only one item or at boundaries */
.pocket-skip-arrow.hidden {
    display: none;
}

/* Magnifying glass */
.pocket-magnifier {
    position: fixed;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5), inset 0 0 10px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    pointer-events: none;
    display: none;
    z-index: 100;
}

.pocket-magnifier.active {
    display: block;
}

.pocket-magnifier canvas {
    width: 100%;
    height: 100%;
}

/* Pocket close button - matches canvas style */
.pocket-close-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 300; /* Above avatar container (250) */
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.3);
    font-size: 24px;
    cursor: pointer;
    padding: 10px;
    line-height: 1;
    transition: color 0.2s ease;
}

.pocket-close-btn:hover {
    color: rgba(255, 255, 255, 0.7);
}

/* Pocket grid close button - for closing the inventory overlay */
.pocket-grid-close-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10010; /* Above inventory overlay content */
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 28px;
    cursor: pointer;
    padding: 10px;
    line-height: 1;
    transition: color 0.2s ease;
}

.pocket-grid-close-btn:hover {
    color: rgba(255, 255, 255, 0.8);
}

/* Mobile: hide pocket grid close button — use tabs to navigate instead */
@media screen and (max-width: 768px) {
    .pocket-grid-close-btn {
        display: none !important;
    }
}
/* Tablet adjustments for pocket grid close button */
@media screen and (min-width: 769px) and (max-width: 1024px) {
    .pocket-grid-close-btn {
        top: env(safe-area-inset-top, 15px);
        padding-top: 15px;
        font-size: 32px;
        color: white;
    }
}

/* Highlight/feature button for owners - HIDDEN (use grid star instead) */
.pocket-highlight-btn {
    display: none !important;
}

.pocket-viewing-nav {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    opacity: 1;
    transition: opacity 0.6s ease-out;
}

.pocket-viewing-nav.hidden {
    opacity: 0;
}

.pocket-nav-hint {
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
    font-style: italic;
    text-align: center;
}
@media (max-width: 768px) {
    .pocket-nav-hint { display: none !important; }
}

/* ============================================================================
   POCKET SCROLL VIEW MODE - Vertical scrolling through all items
   ============================================================================ */

.pocket-scroll-container {
    width: 100%;
    height: 100%;
    overflow: hidden;
    position: relative;
}

.pocket-scroll-content {
    width: 100%;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

.pocket-scroll-item {
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 20px;
    box-sizing: border-box;
}

/* PDF Cover in Scroll View */
.pocket-scroll-pdf {
    cursor: pointer;
    transition: transform 0.2s ease;
}

.pocket-scroll-pdf:active {
    transform: scale(0.98);
}

.pdf-cover-wrapper {
    position: relative;
    display: inline-block;
}

.pdf-cover-canvas {
    display: block;
    box-shadow:
        0 0 40px rgba(255, 255, 255, 0.12),
        0 0 80px rgba(255, 255, 255, 0.06);
    border-radius: 2px;
}

.pdf-cover-glow {
    position: absolute;
    top: -20px;
    left: -20px;
    right: -20px;
    bottom: -20px;
    background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.08) 0%, transparent 70%);
    pointer-events: none;
    z-index: -1;
}

.pdf-cover-label {
    margin-top: 16px;
    color: rgba(255, 255, 255, 0.4);
    font-size: 13px;
    font-family: Georgia, serif;
    font-style: italic;
    text-transform: lowercase;
    letter-spacing: 1px;
}

/* Images in Scroll View */
.pocket-scroll-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.scroll-view-image {
    max-width: 95vw;
    max-height: 95vh;
    object-fit: contain;
}

/* Text in Scroll View */
.pocket-scroll-text {
    width: 100%;
    max-width: 800px;
}

.scroll-view-text {
    color: #ccc;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 18px;
    line-height: 1.8;
    text-align: left;
    padding: 30px 0;
}

/* Video/Movie in Scroll View */
.pocket-scroll-video,
.pocket-scroll-movie {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.scroll-video-wrapper,
.scroll-movie-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 95vw;
    max-height: 90vh;
}

.scroll-view-thumbnail {
    max-width: 95vw;
    max-height: 85vh;
    object-fit: contain;
}

.scroll-view-movie-preview {
    max-width: 95vw;
    max-height: 85vh;
    object-fit: contain;
    background: #000;
}

/* YouTube iframe in scroll view */
.scroll-youtube-container {
    width: 100%;
    max-width: 95vw;
    aspect-ratio: 16/9;
    max-height: 85vh;
}

.scroll-youtube-container iframe {
    width: 100%;
    height: 100%;
}

.scroll-media-label {
    margin-top: 16px;
    color: rgba(255, 255, 255, 0.4);
    font-size: 13px;
    font-family: Georgia, serif;
    font-style: italic;
    text-transform: lowercase;
    letter-spacing: 1px;
}

/* Unmute button for videos/movies in scroll view */
.scroll-unmute-btn {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: background 0.2s ease;
}

.scroll-unmute-btn:hover {
    background: rgba(0, 0, 0, 0.8);
}

.scroll-unmute-btn.muted::before {
    content: "🔇";
}

.scroll-unmute-btn.unmuted::before {
    content: "🔊";
}

/* Album in Scroll View */
.pocket-scroll-album {
    cursor: pointer;
}

.scroll-view-album-cover {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 4px;
}

.scroll-album-label {
    margin-top: 12px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 13px;
    font-family: Georgia, serif;
    font-style: italic;
}

/* Detail overlay for horizontal swipe navigation */
.pocket-detail-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: black;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Mobile scroll view adjustments */
@media screen and (max-width: 768px) {
    .pocket-scroll-content {
        padding: 60px 15px 100px 15px;
        gap: 50px;
    }

    .scroll-view-text {
        font-size: 16px;
        line-height: 1.7;
        padding: 20px 0;
    }

    .pdf-cover-canvas {
        max-width: 75vw;
    }

    .scroll-play-btn {
        width: 60px;
        height: 60px;
        font-size: 24px;
    }
}

/* Mobile adjustments */
@media screen and (max-width: 768px) {
    .pocket-text-content {
        padding: 25px;
        font-size: 17px;
        max-width: 100%;
    }

    .pocket-pdf-page {
        max-width: 95vw;
        max-height: 85vh;
    }
}

.video-cover.visible {
    opacity: 1;
    pointer-events: auto;
}

/* Play Button Overlay Styles */
#playButtonOverlay {
    transition: opacity 0.3s ease;
}

#playButtonOverlay .play-button {
    position: relative;
    z-index: 1002;
}

#playButtonOverlay .play-button:hover {
    transform: scale(1.1) !important;
    background: rgba(255, 255, 255, 1) !important;
}

#playButtonOverlay .play-button:active {
    transform: scale(0.95) !important;
}

/* Ensure play button is above other elements */
#playButtonOverlay svg {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

/* Hide play button overlay in inventory mode */
.inventory-overlay.visible ~ #playButtonOverlay {
    display: none !important;
}

/* Hide play button overlay when viewing items */
.channel-avatar-container.item-viewing ~ #playButtonOverlay {
    display: none !important;
}

/* Responsive adjustments for different screen sizes */
@media (max-width: 480px) {
    #playButtonOverlay .play-button {
        width: 70px !important;
        height: 70px !important;
    }

    #playButtonOverlay .play-button svg {
        width: 28px !important;
        height: 28px !important;
    }
}

@media (min-width: 1200px) {
    #playButtonOverlay .play-button {
        width: 120px !important;
        height: 120px !important;
    }

    #playButtonOverlay .play-button svg {
        width: 48px !important;
        height: 48px !important;
    }
}

/* Ensure smooth fade out animation */
#playButtonOverlay[style*="opacity: 0"] {
    pointer-events: none;
}

/* Universal Modal System - Updated for borderless, full-screen content with horizontal scroll */
.universal-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.universal-modal.visible {
    opacity: 1;
    visibility: visible;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.95);
    border: none;
    border-radius: 0;
    max-width: 98vw;
    max-height: 98vh;
    min-width: 300px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: none;
}

/* Make modal content even larger for images */
.modal-content.image-modal {
    max-width: 100vw;
    max-height: 100vh;
    width: 100vw;
    height: 100vh;
    top: 0;
    left: 0;
    transform: none;
}

/* Horizontal scroll container for multiple items */
.modal-scroll-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    display: flex;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}

.modal-scroll-container::-webkit-scrollbar {
    display: none;
}

.modal-scroll-container {
    scrollbar-width: none;
}

.modal-scroll-item {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Single item modal (no scroll) */
.modal-content.single-item .modal-scroll-container {
    overflow: hidden;
}

.modal-header {
    display: none;
}

.modal-header h2 {
    margin: 0;
    color: white;
    font-size: 16px;
    font-weight: bold;
    flex: 1;
}

.modal-body {
    flex: 1;
    padding: 10px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

/* Special styling for image modal body */
.modal-body.image-body {
    padding: 0;
    min-height: auto;
}

/* Special styling for text modal body */
.modal-body.text-body {
    padding: 0 20px;
    justify-content: flex-start;
    align-items: stretch;
    cursor: pointer;
}

/* Make sure text content doesn't inherit cursor */
.modal-body.text-body .modal-text-content {
    cursor: default;
}

/* Clickable exit areas for text modals */
.text-exit-area {
    flex-shrink: 0;
    width: 100%;
    cursor: pointer;
    background: transparent;
}

.text-exit-area.top {
    height: 100px;
}

.text-exit-area.bottom {
    height: 100px;
}

.text-exit-area:hover {
    background: rgba(255, 255, 255, 0.02);
}

.modal-body img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    box-shadow: none;
}

/* For full-screen image modals */
.modal-body.image-body img {
    max-width: 100vw;
    max-height: 100vh;
    width: auto;
    height: auto;
}

.modal-navigation {
    display: none;
}

.modal-navigation.hidden {
    display: none;
}

/* New fixed corner navigation */
.modal-nav-corners {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1001;
}

.nav-btn {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: #888888;
    width: 60px;
    height: 60px;
    font-size: 32px;
    font-weight: normal;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    pointer-events: auto;
    border-radius: 0;
}

.nav-btn.prev {
    left: 20px;
}

.nav-btn.next {
    right: 20px;
}

.nav-btn:hover {
    color: #bbbbbb;
    transform: translateY(-50%) scale(1.1);
}

.nav-btn:active {
    transform: translateY(-50%) scale(0.95);
    color: #666666;
}

.nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Hide specific navigation buttons when they shouldn't be shown */
.nav-btn.hidden {
    display: none;
}

/* Modal content types - updated for borderless display */
.modal-text-content {
    color: white;
    line-height: 1.6;
    text-align: justify;
    font-size: 16px;
    max-width: 800px;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
    padding: 20px;
    margin: 20px 0;
    flex-shrink: 0;
    align-self: center;
}

/* Force white color on ALL nested elements in modal text content */
.modal-text-content * {
    color: white !important;
}

.modal-pdf-content {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    width: 100%;
    color: white;
    padding: 0;
    position: relative;
}

.modal-pdf-cover {
    max-width: 300px;
    max-height: 400px;
    box-shadow: none;
    position: relative;
    cursor: pointer;
    /* Glow effect - swap animation name to try different options:
       borderLights = rotating spotlight (original)
       glowPulse = gentle breathing (Option 2)
       glowStatic = constant soft glow (Option 3)
       glowFilm = warm film flicker (Option 4) */
    animation: glowPulse 4s ease-in-out infinite;
    border: none;
}

/* Toast notification animations */
@keyframes toastFadeIn {
    from { opacity: 0; transform: translateX(-50%) translateY(20px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@keyframes toastFadeOut {
    from { opacity: 1; transform: translateX(-50%) translateY(0); }
    to { opacity: 0; transform: translateX(-50%) translateY(20px); }
}

/* OPTION 1: Original rotating spotlight (current) */
@keyframes borderLights {
    0% {
        box-shadow:
            0 0 10px 2px rgba(255, 255, 255, 0.8),
            10px 0 10px 2px rgba(255, 255, 255, 0),
            0 10px 10px 2px rgba(255, 255, 255, 0),
            -10px 0 10px 2px rgba(255, 255, 255, 0),
            0 -10px 10px 2px rgba(255, 255, 255, 0);
    }
    25% {
        box-shadow:
            0 0 10px 2px rgba(255, 255, 255, 0),
            10px 0 10px 2px rgba(255, 255, 255, 0.8),
            0 10px 10px 2px rgba(255, 255, 255, 0),
            -10px 0 10px 2px rgba(255, 255, 255, 0),
            0 -10px 10px 2px rgba(255, 255, 255, 0);
    }
    50% {
        box-shadow:
            0 0 10px 2px rgba(255, 255, 255, 0),
            10px 0 10px 2px rgba(255, 255, 255, 0),
            0 10px 10px 2px rgba(255, 255, 255, 0.8),
            -10px 0 10px 2px rgba(255, 255, 255, 0),
            0 -10px 10px 2px rgba(255, 255, 255, 0);
    }
    75% {
        box-shadow:
            0 0 10px 2px rgba(255, 255, 255, 0),
            10px 0 10px 2px rgba(255, 255, 255, 0),
            0 10px 10px 2px rgba(255, 255, 255, 0),
            -10px 0 10px 2px rgba(255, 255, 255, 0.8),
            0 -10px 10px 2px rgba(255, 255, 255, 0);
    }
    100% {
        box-shadow:
            0 0 10px 2px rgba(255, 255, 255, 0.8),
            10px 0 10px 2px rgba(255, 255, 255, 0),
            0 10px 10px 2px rgba(255, 255, 255, 0),
            -10px 0 10px 2px rgba(255, 255, 255, 0),
            0 -10px 10px 2px rgba(255, 255, 255, 0);
    }
}

/* OPTION 2: Gentle breathing pulse - soft glow fades in and out */
@keyframes glowPulse {
    0%, 100% {
        box-shadow: 0 0 15px 3px rgba(255, 255, 255, 0.2);
    }
    50% {
        box-shadow: 0 0 25px 6px rgba(255, 255, 255, 0.4);
    }
}

/* OPTION 3: Static soft glow - no animation, just constant subtle glow */
@keyframes glowStatic {
    0%, 100% {
        box-shadow: 0 0 20px 4px rgba(255, 255, 255, 0.25);
    }
}

/* OPTION 4: Warm film flicker - occasional subtle warm pulse */
@keyframes glowFilm {
    0%, 90%, 100% {
        box-shadow: 0 0 12px 2px rgba(255, 245, 230, 0.15);
    }
    92% {
        box-shadow: 0 0 18px 4px rgba(255, 240, 220, 0.35);
    }
    95% {
        box-shadow: 0 0 10px 2px rgba(255, 245, 230, 0.1);
    }
    97% {
        box-shadow: 0 0 20px 5px rgba(255, 235, 210, 0.3);
    }
}

.modal-pdf-label {
    position: absolute;
    right: -60px;
    bottom: 10px;
    color: white;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.modal-pdf-actions {
    display: none; /* Hide the Open PDF button */
}

.open-pdf-btn {
    background: var(--channel-accent);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.open-pdf-btn:hover {
    background: darkred;
}

/* Video Modal - Muted autoplay preview with glow effect */
.modal-video-content {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    width: 100%;
    color: white;
    padding: 0;
    position: relative;
    cursor: pointer;
}

.modal-video-glow .modal-video-player-wrapper {
    position: relative;
    width: 100%;
    max-width: 500px;
    aspect-ratio: 16 / 9;
    animation: glowPulse 4s ease-in-out infinite;
    overflow: hidden; /* Hide the enlarged iframe edges */
}

.modal-video-iframe {
    /* Enlarge iframe to crop out YouTube UI elements */
    position: absolute;
    top: -60px;
    left: -60px;
    width: calc(100% + 120px);
    height: calc(100% + 120px);
    pointer-events: none; /* Prevent interaction with iframe */
}

.modal-video-click-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    background: transparent;
    cursor: pointer;
    padding-bottom: 15px;
}

.modal-video-play-hint {
    color: rgba(255, 255, 255, 0.8);
    font-size: 13px;
    font-style: italic;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

/* Movie Modal - muted autoplay preview with glow effect */
.modal-movie-content {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    width: 100%;
    color: white;
    padding: 0;
    position: relative;
    cursor: pointer;
}

.modal-movie-glow .modal-movie-player-wrapper {
    position: relative;
    width: 100%;
    max-width: 500px;
    max-height: 70vh;
    animation: glowPulse 4s ease-in-out infinite;
    overflow: hidden;
}

.modal-movie-video {
    width: 100%;
    height: 100%;
    max-height: 70vh;
    object-fit: contain;
    display: block;
}

.modal-movie-click-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    cursor: pointer;
}

.modal-image-content {
    text-align: center;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* Image itself should not show pointer cursor */
.modal-image-content img {
    cursor: default;
}

.modal-image-info {
    color: white;
    margin-top: 15px;
    font-size: 14px;
    opacity: 0.9;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    position: absolute;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    max-width: 90%;
    text-align: center;
    background: rgba(0, 0, 0, 0.7);
    padding: 8px 16px;
    border-radius: 4px;
}

/* UPDATED: Hide modal in landscape mode - ONLY ON MOBILE DEVICES */
@media screen and (orientation: landscape) and (max-width: 1024px) {
    .universal-modal {
        display: none !important;
    }

    .modal-nav-corners {
        display: none !important;
    }
}

/* Channel Index Overlay - now shows channel grid in normal mode */
/* Start hidden by default - JS adds .visible class when needed */
/* NO transition on initial load - JS adds .animated class after first interaction */
.channel-index-overlay {
    position: fixed;
    top: 80px;
    left: 20px;
    right: 20px;
    bottom: 120px;
    background: transparent;
    z-index: 240;
    opacity: 0;
    transform: translateY(-20px);
    transition: none;
    pointer-events: none;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Only animate after user interacts */
.channel-index-overlay.animated {
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Visible class shows the overlay */
.channel-index-overlay.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* Hidden state - JS adds this class when closing the overlay */
.channel-index-overlay.hidden {
    opacity: 0;
    transform: translateY(-20px);
    pointer-events: none;
}

/* DIRECT CHANNEL LINK: Hide overlay immediately when URL has channel path, but allow when opened */
.direct-channel-link .channel-index-overlay:not(.visible) {
    opacity: 0 !important;
    transform: translateY(-20px) !important;
    pointer-events: none !important;
}

/* DIRECT CHANNEL LINK: Ensure overlay shows when explicitly opened */
.direct-channel-link .channel-index-overlay.visible {
    display: flex !important;
    opacity: 1 !important;
    transform: translateY(0) !important;
    pointer-events: auto !important;
}

/* GLOBAL CHANNEL ON MOBILE: Hide overlay and antennas immediately - go straight to player */
/* Only hide when NOT explicitly opened (visible class) */
@media screen and (max-width: 1024px) and (orientation: portrait) {
    html.global-channel-active .channel-index-overlay:not(.visible) {
        opacity: 0 !important;
        transform: translateY(-20px) !important;
        pointer-events: none !important;
    }
    html.global-channel-active .antenna-dot {
        opacity: 0 !important;
    }
}

.direct-channel-link .video-cover {
    opacity: 0 !important;
    pointer-events: none !important;
}

.direct-channel-link .channel-avatar-container {
    opacity: 1 !important;
    pointer-events: auto !important;
}

/* Hide channel info until correct channel loads */
.direct-channel-link .channel-info-display {
    opacity: 0;
}

.direct-channel-link .header-info {
    opacity: 0;
}

/* Channel Index Header - hidden */
.channel-index-header {
    display: none;
}

/* Age Daily title link at top of index */
.channel-index-global {
    display: flex;
    justify-content: center;
    padding: 20px 0 15px 0;
    position: relative;
    z-index: 2;
}

.channel-index-title-link {
    font-family: Arial, sans-serif;
    font-size: 14px;
    font-weight: bold;
    color: white;
    cursor: pointer;
    text-decoration: none;
    transition: text-decoration 0.2s ease;
}

.channel-index-title-link:hover {
    text-decoration: underline;
}

/* Channel Index Tabs */
.channel-index-tabs {
    display: flex;
    justify-content: flex-start;
    gap: 20px;
    padding: 10px 20px 15px 20px;
    position: relative;
    z-index: 2;
}

.channel-index-tab {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 13px;
    font-weight: bold;
    padding: 4px 0;
    cursor: pointer;
    transition: color 0.2s ease;
    font-family: inherit;
    text-transform: lowercase;
    border-bottom: 2px solid transparent;
}

.channel-index-tab:hover {
    color: rgba(255, 255, 255, 0.8);
}

.channel-index-tab.active {
    color: white;
    border-bottom: 2px solid white;
}

/* Channel Index backdrop - full clickable area behind content */
.channel-index-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    z-index: 1;
    cursor: pointer;
}

/* Channel Index content area - grid layout */
.channel-index-content {
    flex: 1;
    color: var(--channel-accent);
    font-size: 14px;
    line-height: 1.6;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 15px;
    align-content: center;
    justify-items: center;
    padding: 10px 20px 20px 20px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--channel-accent) transparent;
    position: relative;
    z-index: 2;
}

/* Adjust grid for fewer items */
.channel-index-content.few-items {
    grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
    justify-content: center;
}

.channel-index-content::-webkit-scrollbar {
    width: 6px;
}

.channel-index-content::-webkit-scrollbar-track {
    background: transparent;
}

.channel-index-content::-webkit-scrollbar-thumb {
    background: var(--channel-accent);
    border-radius: 3px;
}

/* Channel item styling for grid */
.channel-index-item-grid {
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: all 0.3s ease;
    width: 60px;
    height: auto;
    position: relative;
    z-index: 3;
}

.channel-index-item-grid:hover {
    transform: scale(1.1);
}

.channel-index-item-grid:active {
    transform: scale(0.95);
}

.channel-index-grid-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border: 2px solid var(--channel-accent);
    margin-bottom: 4px;
}

.channel-index-grid-avatar.global-channel {
    border: 2px solid gold;
}

.channel-index-grid-title {
    font-size: 7px;
    font-weight: bold;
    color: white;
    line-height: 1.1;
    max-width: 60px;
    word-wrap: break-word;
    text-align: center;
}

/* Current channel highlighting */
.channel-index-item-grid.current .channel-index-grid-title {
    color: var(--channel-accent);
    font-weight: bold;
}

.channel-index-item-grid.current .channel-index-grid-avatar {
    border: 2px solid var(--channel-accent);
    box-shadow: 0 0 10px rgba(255, 0, 0, 0.5);
}

/* Empty state for channel index tabs */
.channel-index-empty {
    grid-column: 1 / -1;
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
    padding: 40px 20px;
}

/* Schedule tab content */
.schedule-content {
    grid-column: 1 / -1;
    width: 100%;
    padding: 0 20px;
}

.schedule-loading,
.schedule-empty {
    text-align: center;
    padding: 40px 20px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
}

.schedule-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.schedule-item {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 16px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.schedule-datetime {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 120px;
    flex-shrink: 0;
}

.schedule-day {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.schedule-date {
    font-size: 20px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
}

.schedule-time {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.6);
}

.schedule-title {
    flex: 1;
    font-size: 22px;
    color: white;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 400;
}

.schedule-channel {
    font-size: 22px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    flex-shrink: 0;
    transition: opacity 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.schedule-channel:hover {
    opacity: 0.8;
}

/* Mobile Age Daily label — upper right on global channel */
.mobile-age-daily-label {
    display: none;
}

@media screen and (max-width: 768px) {
    body.mobile-global-tabs .mobile-age-daily-label {
        display: block;
        position: fixed;
        top: 12px;
        right: 15px;
        color: white;
        font-size: 18px;
        font-weight: bold;
        font-family: Arial, sans-serif;
        z-index: 99999;
        cursor: pointer;
        text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
        pointer-events: auto;
    }

    /* Hide on non-global channels */
    body:not(.mobile-global-tabs) .mobile-age-daily-label {
        display: none !important;
    }

    /* Hide when index is open */
    body.index-open .mobile-age-daily-label {
        display: none !important;
    }
}

/* Age Daily clock avatar in index grid */
.age-daily-clock {
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.age-daily-clock svg {
    width: 100%;
    height: 100%;
}

/* Age Daily link in index tabs */
.channel-index-ad-link {
    margin-left: auto;
    color: white;
    font-weight: bold;
    font-size: 13px;
    cursor: pointer;
    text-decoration: none;
}

.schedule-channel-sub {
    font-size: 10px;
    font-weight: normal;
    text-transform: none;
    letter-spacing: 0;
    color: rgba(255, 255, 255, 0.4);
    text-align: center;
    margin-top: 2px;
}

.schedule-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    min-width: 0;
}

.schedule-info .schedule-title {
    flex: 1;
}

.schedule-director {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
    font-style: italic;
}

.schedule-type {
    display: inline-block;
    font-size: 11px;
    font-weight: bold;
    padding: 4px 8px;
    border-radius: 4px;
    flex-shrink: 0;
    letter-spacing: 0.5px;
}

.schedule-type-screening {
    background: rgba(100, 100, 255, 0.3);
    color: #8888ff;
}

.schedule-type-live {
    background: rgba(255, 59, 48, 0.3);
    color: #ff3b30;
}

.schedule-type-now-playing {
    background: rgba(0, 200, 83, 0.3);
    color: #00c853;
}

/* Screening info beneath channel avatar in desktop index */
.channel-index-screening-info {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    text-align: center;
    margin-top: 2px;
    max-width: 80px;
    line-height: 1.3;
}

.channel-index-screening-info em {
    color: rgba(255, 255, 255, 0.7);
}

/* Mobile adjustments for schedule */
@media screen and (max-width: 480px) {
    .schedule-item {
        flex-wrap: wrap;
        gap: 10px;
        padding: 14px 0;
    }

    .schedule-datetime {
        flex-direction: row;
        gap: 10px;
        align-items: center;
        min-width: auto;
        width: 100%;
    }

    .schedule-day {
        font-size: 13px;
    }

    .schedule-date {
        font-size: 18px;
    }

    .schedule-time {
        font-size: 14px;
    }

    .schedule-title {
        width: 100%;
        order: 3;
        font-size: 18px;
    }

    .schedule-director {
        order: 4;
        font-size: 12px;
    }

    .schedule-channel {
        order: 5;
        font-size: 18px;
    }
}

/* UPDATED: Hide channel index in landscape mode - ONLY ON MOBILE DEVICES */
@media screen and (orientation: landscape) and (max-width: 1024px) {
    .channel-index-overlay {
        display: none !important;
    }
}

/* Loading */
.loading {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 18px;
    z-index: 50;
    display: none; 
}

/* Channel avatar styles */
.channel-avatar {
    position: fixed;
    top: 60px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: var(--channel-accent);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border: 3px solid var(--channel-accent);
    z-index: 250;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.channel-avatar.blog-mode {
    opacity: 0 !important;
    pointer-events: none !important;
}

.antenna-dot {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--channel-accent);
    border-radius: 50%;
    top: -19px;
    z-index: 251;
    transition: opacity 0.3s ease;
    opacity: 0; /* Start hidden - JS will show when appropriate */
}

.antenna-dot.left {
    left: 11px;
}

.antenna-dot.right {
    right: 11px;
}

.antenna-dot.hidden {
    opacity: 0;
}

/* Antennas hidden */
.antenna-dot.visible {
    opacity: 0;
}

.antenna-dot.item-viewing {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.channel-avatar-container.item-viewing {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

/* Hide avatar and antenna dots when in folder mode */
.channel-avatar-container.folder-mode .channel-avatar {
    opacity: 0;
    pointer-events: none;
}

.channel-avatar-container.folder-mode .antenna-dot {
    opacity: 0;
    pointer-events: none;
}

.age-daily.item-viewing {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.typo-controls.item-viewing {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

/* Channel avatar container - hidden by default since overlay starts visible */
.channel-avatar-container {
    position: fixed;
    top: 60px;
    right: 20px;
    width: 60px;
    height: 60px;
    z-index: 250;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    opacity: 0;
    pointer-events: none;
}

.channel-avatar-container.blog-mode {
    opacity: 0 !important;
    pointer-events: none !important;
}

.channel-avatar-container:active {
    transform: scale(0.9);
}

.channel-avatar-container::before,
.channel-avatar-container::after {
    content: '';
    position: absolute;
    width: 2px;
    height: 15px;
    background: var(--channel-accent);
    top: -15px;
    transition: opacity 0.3s ease;
}

.channel-avatar-container::before {
    left: 15px;
    transform: rotate(-20deg);
}

.channel-avatar-container::after {
    right: 15px;
    transform: rotate(20deg);
}

.channel-avatar-container.blog-mode::before,
.channel-avatar-container.blog-mode::after {
    opacity: 0;
}

/* Mobile: Hide avatar completely when in pocket/blog mode */
@media screen and (max-width: 768px) {
    .channel-avatar-container.blog-mode {
        opacity: 0 !important;
        pointer-events: none !important;
    }

    .channel-avatar-container.blog-mode::before,
    .channel-avatar-container.blog-mode::after {
        opacity: 0 !important;
    }

    .channel-avatar-container.blog-mode .antenna-dot {
        opacity: 0 !important;
    }
}

/* Global channel special styling */
.channel-avatar-container.global-channel {
    border: none;
    width: auto;
    height: auto;
    cursor: default;
    pointer-events: none;
}

.channel-avatar-container.global-channel .channel-avatar {
    display: none;
}

.channel-avatar-container.global-channel::before,
.channel-avatar-container.global-channel::after {
    display: none;
}

.channel-avatar-container.global-channel .antenna-dot {
    display: none;
}

/* Hide hover highlight on global channel */
.channel-avatar-container.global-channel .avatar-hover-highlight {
    display: none !important;
}

/* Collab channel contributor avatar - shows contributor's avatar when viewing their item */
.channel-avatar-container.collab-contributor {
    cursor: pointer;
    pointer-events: auto;
}

.channel-avatar-container.collab-contributor .channel-avatar {
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.5);
    transition: box-shadow 0.2s ease;
}

.channel-avatar-container.collab-contributor:hover .channel-avatar {
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.8);
}

/* Global channel title - replaces avatar on global channel (desktop only) */
.global-channel-title {
    display: none;
    color: white;
    font-size: 120px;
    font-family: 'Times New Roman', Times, serif;
    font-style: italic;
    white-space: nowrap;
}

.global-channel-title span {
    display: inline;
}

/* Two-line layout when shop is open */
.global-channel-title.two-line {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    white-space: normal;
    font-size: 0; /* Hide &nbsp; between spans */
    gap: 0;
}

.global-channel-title.two-line span {
    display: block;
    font-size: 120px;
    line-height: 0.85;
}

/* Hide big Age Daily title on mobile - show in channel-info-display instead */
@media screen and (max-width: 1024px) and (orientation: portrait) {
    .global-channel-title {
        display: none !important;
    }
}

.channel-avatar-container.global-channel .global-channel-title {
    display: flex;
}

/* Also show via body/html class for direct global channel loads */
body.global-channel-active .channel-avatar-container .global-channel-title,
html.global-channel-active .channel-avatar-container .global-channel-title {
    display: flex;
}

/* Hide Age Daily title when channel index is open */
.channel-index-overlay.visible ~ .channel-avatar-container .global-channel-title {
    display: none !important;
}

/* Hide Age Daily title when pocket/inventory is open */
.inventory-overlay.visible ~ .channel-avatar-container .global-channel-title {
    display: none !important;
}

/* Make avatar container visible on global channel */
body.global-channel-active .channel-avatar-container,
html.global-channel-active .channel-avatar-container {
    opacity: 1;
    pointer-events: auto;
}

/* Hide the regular avatar image on global channel */
body.global-channel-active .channel-avatar-container .channel-avatar,
html.global-channel-active .channel-avatar-container .channel-avatar {
    opacity: 0;
}

/* Channel info display */
.channel-info-display {
    position: fixed;
    bottom: 55px;
    right: 20px;
    color: white;
    font-size: 18px;
    text-align: right;
    z-index: 200;
    line-height: 1.4;
    opacity: 1;
    transition: opacity 0.3s ease;
    pointer-events: none; /* Container doesn't catch events */
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.channel-info-display.item-viewing {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

/* Video title display (desktop only) */
.channel-video-title {
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 2px;
    opacity: 0.9;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.9), 0 0 20px rgba(0, 0, 0, 0.7);
    max-width: 400px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Channel source info (via ChannelName) */
.channel-info-source {
    font-size: 14px;
    margin-bottom: 4px;
    opacity: 0.9;
    pointer-events: auto; /* Enable clicks on source */
    cursor: pointer;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.9), 0 0 20px rgba(0, 0, 0, 0.7); /* Visibility against black */
}

/* About link (home channel only) */
.channel-info-about {
    font-size: 14px;
    color: white;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.channel-info-about:hover {
    opacity: 1;
}

/* Hide video title on mobile */
@media (max-width: 768px) {
    .channel-video-title {
        display: none !important;
    }
}

.channel-info-source span {
    pointer-events: auto;
}

.channel-info-name {
    font-weight: bold;
    margin-bottom: 4px;
}

.channel-info-subtitle {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 4px;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.9), 0 0 20px rgba(0, 0, 0, 0.7);
}

.channel-info-subtitle a {
    font-weight: bold;
    color: inherit;
    text-decoration: none;
    pointer-events: auto;
    cursor: pointer;
}

.channel-info-subtitle a:hover {
    text-decoration: underline;
}

.channel-info-location {
    font-size: 16px;
    opacity: 0.8;
}

/* External link (legacy - separate container above notebook/pocket) */
.channel-info-external {
    text-align: right;
    margin-bottom: 4px;
}

.channel-info-external a {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: underline;
    opacity: 0.8;
    transition: opacity 0.2s;
    pointer-events: auto;
}

.channel-info-external a:hover {
    opacity: 1;
}

/* External link - inline with notebook/pocket (matches their styling exactly) */
.channel-info-external-link {
    font-size: 12px;
    color: white;
    opacity: 0.8;
    text-decoration: underline;
    cursor: pointer;
    display: block;
    transition: opacity 0.3s ease;
    pointer-events: auto;
    position: relative;
    z-index: 250;
    padding: 8px;
    margin: -8px;
}

.channel-info-external-link:hover {
    opacity: 1;
}

.channel-info-external-link:active {
    transform: scale(0.95);
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

/* External link row - separate line below main links, positioned absolutely so it doesn't push content */
.channel-info-external-row {
    position: absolute;
    top: 100%;
    right: 0;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    margin-top: 5px;
    white-space: nowrap;
}

.channel-info-external-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
}

/* Mobile external link - hidden on desktop */
@media (min-width: 769px) {
    .channel-info-external-mobile {
        display: none !important;
    }
}

/* Container for links - horizontal layout */
.channel-info-links {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 4px;
}

/* Global channel info styling */
.channel-info-display.global-channel .channel-info-name {
    color: #0f0;
}

/* Channel preview styles */
.channel-preview {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: black;
    z-index: 50;
    opacity: 0;
    transform: translateY(100%);
    transition: none;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.channel-preview.from-top {
    transform: translateY(-100%);
}

.channel-preview-avatar {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border: 6px solid var(--channel-accent);
    margin-bottom: 30px;
    box-shadow: 0 0 50px rgba(255, 0, 0, 0.3);
}

.channel-preview-info {
    color: var(--channel-accent);
    font-size: 18px;
    text-align: center;
    max-width: 300px;
}

.channel-preview-info h1 {
    margin: 0 0 15px 0;
    font-size: 32px;
    text-decoration: underline;
}

.channel-preview-info .bio {
    font-size: 16px;
    line-height: 1.4;
}

.channel-preview-info a {
    color: var(--channel-accent);
    text-decoration: underline;
}

/* Global channel preview styling */
.channel-preview.global .channel-preview-avatar {
    border: 6px solid gold;
    box-shadow: 0 0 50px rgba(255, 215, 0, 0.3);
}

.channel-preview.global .channel-preview-info {
    color: gold;
}

.channel-preview.global .channel-preview-info a {
    color: gold;
}

/* Inventory overlay */
.inventory-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 80px;
    background: transparent;
    z-index: 240;
    opacity: 0;
    transition: opacity 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    pointer-events: none;
    overflow-y: auto;
    overflow-x: hidden;
    display: block;
}

/* Safari needs solid background due to video autoplay behavior */
@supports (-webkit-touch-callout: none) {
    .inventory-overlay {
        background: black;
    }
}

/* Also target Safari desktop */
_::-webkit-full-page-media, _:future, :root .inventory-overlay {
    background: black;
}

.inventory-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

/* Drag-and-drop visual indicator */
.inventory-overlay.drag-over {
    outline: 3px dashed rgba(100, 200, 255, 0.5);
    outline-offset: -20px;
}

.inventory-overlay.drag-over #inventoryContent::before {
    content: 'Drop to add';
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: rgba(100, 200, 255, 0.8);
    font-size: 24px;
    font-style: italic;
    z-index: 300;
    pointer-events: none;
}

/* Black blocks at top and bottom - only for Safari */
.inventory-overlay::before,
.inventory-overlay::after {
    content: '';
    position: fixed;
    left: 0;
    right: 0;
    height: 120px;
    background: transparent;
    z-index: 250;
    pointer-events: none;
}

/* Safari needs the black blocks */
@supports (-webkit-touch-callout: none) {
    .inventory-overlay::before,
    .inventory-overlay::after {
        background: black;
    }
}

_::-webkit-full-page-media, _:future, :root .inventory-overlay::before,
_::-webkit-full-page-media, _:future, :root .inventory-overlay::after {
    background: black;
}

.inventory-overlay::before {
    top: 0;
}

.inventory-overlay::after {
    bottom: 80px; /* Above the nav controls */
    height: 110px;
}

/* Mobile: slightly smaller blocks */
@media screen and (max-width: 768px) {
    .inventory-overlay::before,
    .inventory-overlay::after {
        height: 100px;
    }
}

/* Pocket close button - matches canvas style */
.pocket-close-x {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10002;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 28px;
    cursor: pointer;
    padding: 10px;
    line-height: 1;
    transition: color 0.2s ease;
}

.pocket-close-x:hover {
    color: rgba(255, 255, 255, 0.8);
}

/* Mobile pocket close button - always visible */
@media screen and (max-width: 1024px) {
    .pocket-close-x {
        color: white !important;
        font-size: 32px !important;
        z-index: 10010 !important;
        top: env(safe-area-inset-top, 20px) !important;
        padding-top: 20px !important;
    }
}

/* ============================================================================
   CANVAS CHANNEL SWITCH ARROWS (mobile only)
   ============================================================================ */

/* Hide by default on desktop */
.canvas-channel-arrow {
    display: none;
}

/* Mobile-only channel switch arrows - matches pocket arrow style */
@media screen and (max-width: 1024px) {
    .canvas-channel-arrow {
        display: flex;
        align-items: center;
        justify-content: center;
        position: fixed;
        right: 15px;
        width: 44px;
        height: 36px;
        background: transparent;
        border: 1px solid var(--channel-accent, white);
        border-radius: 4px;
        color: var(--channel-accent, white);
        z-index: 10005;
        cursor: pointer;
        transition: background-color 0.2s ease;
        -webkit-tap-highlight-color: transparent;
    }

    .canvas-channel-arrow:active {
        background: color-mix(in srgb, var(--channel-accent, white) 20%, transparent);
    }

    .canvas-channel-arrow svg {
        width: 24px;
        height: 24px;
    }

    /* Up arrow - above canvas area */
    .canvas-channel-up {
        top: 130px;
    }

    /* Down arrow - below canvas area */
    .canvas-channel-down {
        bottom: 100px;
    }
}

/* Landscape adjustments */
@media screen and (max-width: 1024px) and (orientation: landscape) {
    .canvas-channel-up {
        top: 80px;
    }

    .canvas-channel-down {
        bottom: 60px;
    }
}

/* ============================================================================
   SAFARI VIDEO PLAY OVERLAY
   Black overlay with play button over just the video area (UI stays visible)
   ============================================================================ */

/* Black overlay covering only the video area */
.safari-video-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: black;
    z-index: 200; /* Below UI (avatar=250, channel-info=200+) but above video */
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Play button in center */
.safari-video-play-btn {
    color: var(--channel-accent, white);
    cursor: pointer;
    pointer-events: auto;
    padding: 40px;
}

.safari-video-play-btn svg {
    width: 80px;
    height: 80px;
    pointer-events: none;
}

/* Hide video title when Safari overlay is showing */
body:has(.safari-video-overlay) .channel-video-title {
    display: none !important;
}

/* Safari canvas play button - appears over canvas on Safari initial load */
.safari-canvas-play-btn {
    position: fixed;
    top: 50%;
    left: 40px;
    transform: translateY(-50%);
    z-index: 100005;
    color: var(--channel-accent, white);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: opacity 0.2s ease;
}

.safari-canvas-play-btn:hover {
    opacity: 0.8;
}

.safari-canvas-play-btn:active {
    opacity: 0.6;
}

.safari-canvas-play-btn .play-label {
    font-family: 'Times New Roman', Times, serif;
    font-style: italic;
    font-size: 32px;
    color: var(--channel-accent, white);
}

.safari-canvas-play-btn svg {
    width: 160px;
    height: 160px;
    pointer-events: none;
    color: var(--channel-accent, white);
}

.safari-canvas-play-btn .channel-label {
    font-family: Arial, sans-serif;
    font-size: 48px;
    font-weight: bold;
    color: var(--channel-accent, white);
    text-transform: uppercase;
}

/* Channel info uses accent color when canvas/notes view is open */
body:has(.notes-view-overlay.active) .channel-info-display .channel-info-name,
body:has(.notes-view-overlay.active) .channel-info-display .channel-info-location,
body:has(.notes-view-overlay.active) .channel-info-display .channel-info-subtitle,
body:has(.notes-view-overlay.active) .channel-info-display .channel-info-pocket,
body:has(.notes-view-overlay.active) .channel-info-display .channel-info-notes,
body:has(.notes-view-overlay.active) .channel-info-display .channel-info-about {
    color: var(--channel-accent, white) !important;
}

/* Pocket drafts toggle button */
/* Pocket tabs (public/private) */
.pocket-tabs {
    position: fixed;
    top: 30px;
    left: 30px;
    z-index: 10002;
    display: none; /* Hidden by default - shown via JS */
    gap: 20px;
}

.pocket-tab {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
    font-weight: bold;
    padding: 4px 0;
    cursor: pointer;
    transition: color 0.2s ease;
    font-family: inherit;
    text-transform: lowercase;
    border-bottom: 2px solid transparent;
}

.pocket-tab:hover {
    color: rgba(255, 255, 255, 0.8);
}

.pocket-tab.active {
    color: white;
    border-bottom: 2px solid white;
}

/* Mobile: Pocket tabs with black background block */
@media screen and (max-width: 768px) {
    .pocket-tabs {
        position: fixed;
        top: 5px;
        left: 15px;
        right: 15px;
        padding: 10px 0 15px 0;
        background: linear-gradient(to bottom,
            rgba(0, 0, 0, 1) 0%,
            rgba(0, 0, 0, 1) 70%,
            rgba(0, 0, 0, 0) 100%);
        margin: 0;
    }
}

/* Canvas tabs container - bottom left, shown when canvas view is open */
.canvas-tabs-container {
    position: fixed;
    bottom: 105px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100000; /* Very high - above everything */
    display: flex;
    align-items: center;
    gap: 20px;
}


.canvas-tabs {
    display: flex;
    gap: 15px;
}

.canvas-tab {
    position: relative;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
    font-weight: bold;
    padding: 4px 0;
    cursor: pointer;
    transition: color 0.2s ease;
    font-family: inherit;
    text-transform: lowercase;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    user-select: none;
}

.canvas-tab:hover {
    color: rgba(255, 255, 255, 0.8);
}

.canvas-tab.active {
    color: var(--channel-accent);
    border-bottom: 2px solid var(--channel-accent);
}

.canvas-tab.dragging {
    opacity: 0.5;
}

/* Rename option on hover */
.canvas-tab-rename {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 4px;
    background: rgba(0, 0, 0, 0.8);
    color: rgba(255, 255, 255, 0.6);
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 3px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s ease;
    white-space: nowrap;
}

.canvas-tab:hover .canvas-tab-rename {
    opacity: 1;
}

.canvas-tab-rename:hover {
    color: white;
}

/* Notebook toolbar buttons */
.notebook-destroy-btn,
.notebook-new-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
    cursor: pointer;
    padding: 4px 8px;
    font-family: inherit;
}

.notebook-destroy-btn:hover {
    color: #ff6b6b;
}

.notebook-new-btn:hover {
    color: white;
}

/* Canvas creator modal */
.canvas-creator-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #1a1a1a;
    border-radius: 12px;
    padding: 24px;
    z-index: 10010;
    min-width: 300px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.canvas-creator-title {
    color: white;
    font-size: 16px;
    margin: 0 0 20px 0;
    font-weight: normal;
}

.canvas-creator-field {
    margin-bottom: 16px;
}

.canvas-creator-field label {
    display: block;
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
    margin-bottom: 6px;
}

.canvas-creator-field input[type="text"] {
    width: 100%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    padding: 10px 12px;
    color: white;
    font-size: 14px;
    box-sizing: border-box;
}

.canvas-creator-field input[type="text"]:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.4);
}

.canvas-creator-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.canvas-creator-cancel,
.canvas-creator-save {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
}

.canvas-creator-cancel {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.canvas-creator-save {
    background: white;
    color: black;
}

.canvas-creator-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10009;
}

/* Display in channel info button */
.notebook-primary-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.5);
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
    margin-left: 10px;
    transition: all 0.2s ease;
}

.notebook-primary-btn:hover {
    color: white;
    border-color: white;
}

.notebook-primary-btn.is-primary {
    color: rgba(100, 255, 150, 0.8);
    border-color: rgba(100, 255, 150, 0.4);
    cursor: default;
}

/* Mobile: Canvas tabs */
@media screen and (max-width: 768px) {
    .canvas-tabs-container {
        bottom: 40px;
        left: 20px;
        gap: 12px;
    }


    .canvas-tabs {
        gap: 10px;
    }

    .canvas-tab {
        font-size: 12px;
    }

    .canvas-tab-rename {
        display: none; /* No hover on mobile */
    }
}

/* Pocket Screenings View */
.pocket-screenings {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow-y: auto;
    padding: 120px 30px 120px 30px;
    box-sizing: border-box;
}

.pocket-screenings-content {
    max-width: 600px;
    margin: 0 auto;
}

.screenings-table {
    width: 100%;
    border-collapse: collapse;
}

.screenings-table th,
.screenings-table td {
    text-align: left;
    padding: 12px 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 14px;
}

.screenings-table th {
    color: rgba(255, 255, 255, 0.5);
    font-weight: normal;
    text-transform: lowercase;
}

.screenings-table td {
    color: white;
}

.screenings-table .screening-title {
    font-weight: bold;
}

.screenings-table .screening-channel {
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
}

.screenings-table .screening-time {
    white-space: nowrap;
}

.screenings-table .screening-status {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    display: inline-block;
}

.screenings-table .screening-status.upcoming {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
}

.screenings-table .screening-status.live {
    background: rgba(255, 100, 100, 0.3);
    color: #ff6b6b;
}

.screenings-empty {
    text-align: center;
    color: rgba(255, 255, 255, 0.4);
    padding: 40px 20px;
    font-style: italic;
}

@media (max-width: 600px) {
    .pocket-screenings {
        padding: 15px;
    }

    .screenings-table th,
    .screenings-table td {
        padding: 10px 6px;
        font-size: 13px;
    }
}

/* Pocket Split View (Drafts mode) */
.pocket-split-view {
    display: flex;
    width: 100%;
    height: 100%;
    padding-top: 60px; /* Space for fixed button */
    box-sizing: border-box;
}

.pocket-split-left,
.pocket-split-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    min-width: 0;
}

.pocket-split-divider {
    width: 2px;
    background: linear-gradient(to bottom,
        transparent 0%,
        rgba(255, 255, 255, 0.2) 15%,
        rgba(255, 255, 255, 0.2) 85%,
        transparent 100%);
    margin: 60px 10px 20px 10px;
    flex-shrink: 0;
}

.pocket-split-header {
    padding: 10px 15px;
    font-size: 11px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: 1px;
    text-align: center;
    flex-shrink: 0;
}

.pocket-split-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 8px;
    padding: 10px;
    flex: 1;
    align-content: start;
}

.pocket-split-empty {
    grid-column: 1 / -1;
    text-align: center;
    color: rgba(255, 255, 255, 0.3);
    font-size: 12px;
    padding: 30px 10px;
}

/* Split view items - smaller, album-like sizing */
.pocket-split-item {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 4px;
    overflow: hidden;
    cursor: grab;
    background: rgba(255, 255, 255, 0.05);
    transition: transform 0.15s ease, opacity 0.15s ease;
}

.pocket-split-item:active {
    cursor: grabbing;
}

.pocket-split-item.dragging {
    opacity: 0.5;
    transform: scale(0.95);
}

.pocket-split-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pocket-split-item .split-item-text {
    padding: 8px;
    font-size: 9px;
    color: rgba(255, 255, 255, 0.7);
    overflow: hidden;
    height: 100%;
    box-sizing: border-box;
}

.pocket-split-item .split-item-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 16px;
    color: white;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.pocket-split-item .split-item-pdf,
.pocket-split-item .split-item-album,
.pocket-split-item .split-item-voice,
.pocket-split-item .split-item-default {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    font-size: 20px;
    color: rgba(255, 255, 255, 0.5);
}

/* Delete button on split items */
.pocket-split-delete {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(200, 60, 60, 0.9);
    border: none;
    color: white;
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.pocket-split-item:hover .pocket-split-delete {
    opacity: 1;
}

/* Drag over highlight for zones */
.pocket-split-grid.drag-over {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

/* Mobile: Single column stacks side by side */
@media screen and (max-width: 768px) {
    .pocket-split-view {
        padding-top: 50px;
    }

    .pocket-split-grid {
        display: flex;
        flex-direction: column;
        gap: 8px;
        padding: 8px;
    }

    .pocket-split-item {
        width: 100%;
        height: auto;
        aspect-ratio: 1;
    }

    .pocket-split-divider {
        width: 1px;
        margin: 50px 5px 10px 5px;
    }

    .pocket-split-header {
        font-size: 10px;
        padding: 8px 10px;
    }

    .pocket-split-delete {
        opacity: 1;
    }
}

/* Inventory backdrop - full clickable area behind content */
.inventory-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    z-index: 1;
    cursor: pointer;
}

/* Main inventory content area - 4 columns by default */
.inventory-content {
    flex: 1;
    height: 100%;
    color: var(--channel-accent);
    font-size: 14px;
    line-height: 1.6;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: minmax(100px, auto);
    gap: 25px 10px; /* row-gap column-gap */
    align-content: start;
    justify-items: center;
    padding: 350px 20px 180px 20px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--channel-accent) transparent;
    position: relative;
    z-index: 2;
}

/* All item counts start from top for consistent positioning */
.inventory-content.few-items,
.inventory-content.medium-items,
.inventory-content.many-items {
    align-content: start;
}

/* All items flow normally - no blank first slot */
.inventory-content .inventory-item {
    grid-column: auto;
}

/* Mobile: 3 columns */
@media screen and (max-width: 768px) {
    .inventory-content {
        grid-template-columns: repeat(3, 1fr);
        justify-content: center;
        padding: 160px 15px 140px 15px;
    }

    /* Make room for showtimes table when present */
    .inventory-overlay.has-showtimes .inventory-content {
        padding-bottom: 160px;
    }
}

/* Mobile pocket showtimes table */
.pocket-showtimes {
    display: none;
    position: absolute;
    bottom: 10px;
    left: 0;
    right: 0;
    text-align: center;
    padding: 10px 20px;
    z-index: 10;
}

.pocket-showtimes-label {
    font-family: Arial, sans-serif;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.6);
    text-transform: lowercase;
    margin-bottom: 6px;
}

.pocket-showtimes-table {
    width: auto;
    margin: 0 auto;
    border-collapse: collapse;
}

.pocket-showtimes-table td {
    font-family: Arial, sans-serif;
    font-size: 11px;
    color: white;
    padding: 3px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.pocket-showtimes-table tr:last-child td {
    border-bottom: none;
}

.pocket-showtimes-table td:first-child {
    text-align: left;
}

.pocket-showtimes-table td:last-child {
    text-align: right;
    opacity: 0.7;
}

/* Only show showtimes on mobile */
@media screen and (min-width: 769px) {
    .pocket-showtimes {
        display: none !important;
    }
}

/* Single item should span all columns and be centered */
.inventory-content.single-item {
    grid-template-columns: 1fr;
    align-content: center;
    justify-items: center;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Reset first item positioning for single item view */
.inventory-content.single-item .inventory-item:nth-child(1) {
    grid-column: auto;
}

/* Single video items should have constrained size like folder items */
.inventory-content.single-item .inventory-item.video-item {
    width: auto;
    max-width: 400px; /* Reasonable max width for single video */
    height: auto;
}

/* Desktop: larger single video */
@media screen and (min-width: 1025px) {
    .inventory-content.single-item .inventory-item.video-item {
        max-width: 500px;
    }
}

/* Mobile: smaller single video */
@media screen and (max-width: 1024px) {
    .inventory-content.single-item .inventory-item.video-item {
        max-width: 300px;
    }
}

.inventory-content::-webkit-scrollbar {
    width: 6px;
}

.inventory-content::-webkit-scrollbar-track {
    background: transparent;
}

.inventory-content::-webkit-scrollbar-thumb {
    background: var(--channel-accent);
    border-radius: 3px;
}

.inventory-item {
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
    /* Glowing edges around items */
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.5),
                0 0 30px rgba(255, 255, 255, 0.2);
    z-index: 3;
}

/* Text items should not have glow */
.inventory-item.text-item {
    box-shadow: none;
}

/* Delete button for pocket items (owner mode) */
.pocket-item-delete {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(200, 60, 60, 0.9);
    border: 2px solid white;
    color: white;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.inventory-item:hover .pocket-item-delete {
    opacity: 1;
}

.pocket-item-delete:hover {
    background: rgba(220, 40, 40, 1);
    transform: scale(1.1);
}

/* Mobile: simple red X without circle */
@media screen and (max-width: 768px) {
    .pocket-item-delete {
        background: transparent;
        border: none;
        color: rgba(220, 60, 60, 1);
        font-size: 20px;
        width: auto;
        height: auto;
        top: -6px;
        right: -4px;
    }

    .pocket-item-delete:hover {
        background: transparent;
        transform: none;
    }
}

/* Edit button for pocket items - lower left corner on hover */
.pocket-item-edit {
    position: absolute;
    bottom: 6px;
    left: 6px;
    padding: 3px 8px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    color: white;
    font-size: 10px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    text-transform: lowercase;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s ease, background 0.2s ease;
    z-index: 10;
    pointer-events: auto;
}

.inventory-item:hover .pocket-item-edit {
    opacity: 1;
}

.pocket-item-edit:hover {
    background: rgba(0, 0, 0, 0.9);
}

/* Edit modal for pocket items */
.pocket-edit-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
}

.pocket-edit-modal-content {
    background: #1a1a1a;
    border-radius: 12px;
    padding: 20px;
    width: 100%;
    max-width: 320px;
}

.pocket-edit-modal-content h3 {
    margin: 0 0 15px 0;
    font-size: 16px;
    font-weight: 500;
    color: white;
    text-transform: capitalize;
}

.pocket-edit-input {
    width: 100%;
    padding: 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: white;
    font-size: 14px;
    box-sizing: border-box;
}

.pocket-edit-input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.4);
}

.pocket-edit-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.pocket-edit-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.pocket-edit-actions button {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
}

.pocket-edit-cancel {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.pocket-edit-cancel:hover {
    background: rgba(255, 255, 255, 0.15);
}

.pocket-edit-save {
    background: white;
    color: black;
    font-weight: 500;
}

.pocket-edit-save:hover {
    background: rgba(255, 255, 255, 0.9);
}

/* Highlight/star button in pocket grid */
.pocket-item-highlight {
    position: absolute;
    top: -8px;
    left: -8px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(80, 80, 80, 0.9);
    border: 2px solid white;
    color: white;
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.inventory-item:hover .pocket-item-highlight {
    opacity: 1;
}

.pocket-item-highlight:hover {
    background: rgba(100, 100, 100, 1);
    transform: scale(1.1);
}

.pocket-item-highlight.active {
    background: rgba(180, 140, 0, 0.9);
    color: gold;
    opacity: 1;
}

.pocket-item-highlight.active:hover {
    background: rgba(200, 160, 0, 1);
}

.inventory-item .pocket-item-highlight {
    pointer-events: auto;
}

/* Read-only star indicator for highlighted items in others' pockets */
.pocket-item-highlight-indicator {
    position: absolute;
    top: -8px;
    left: -8px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(180, 140, 0, 0.9);
    color: gold;
    font-size: 14px;
    line-height: 1;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

/* "Highlighted!" feedback that appears and fades */
.highlight-feedback {
    transform: translate(-50%, -50%);
    color: white;
    font-size: 14px;
    font-weight: bold;
    font-family: Arial, sans-serif;
    white-space: nowrap;
    z-index: 100000;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.highlight-feedback.visible {
    opacity: 1;
}

.highlight-feedback.fade-out {
    opacity: 0;
}

/* Draft toggle button for pocket items */
.pocket-item-draft-toggle {
    position: absolute;
    bottom: 4px;
    right: 4px;
    padding: 3px 8px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    color: rgba(255, 255, 255, 0.9);
    font-size: 9px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    text-transform: lowercase;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s ease, background 0.2s ease;
    z-index: 10;
    white-space: nowrap;
    pointer-events: none;
}

.inventory-item:hover .pocket-item-draft-toggle {
    opacity: 1;
    pointer-events: auto;
}

.pocket-item-draft-toggle:hover {
    background: rgba(0, 0, 0, 0.9);
}

/* Mobile: show on tap via active state */
@media screen and (max-width: 768px) {
    .pocket-item-draft-toggle {
        font-size: 10px;
        padding: 4px 10px;
    }

    /* On mobile, always show the button so users can tap it */
    .inventory-item .pocket-item-draft-toggle {
        opacity: 1;
        pointer-events: auto;
    }
}

/* Drag and drop states for pocket items */
.inventory-item.dragging {
    opacity: 0.5;
    transform: scale(0.95);
}

.inventory-item.drag-over {
    outline: 2px dashed white;
    outline-offset: 4px;
}

.inventory-item[draggable="true"] {
    cursor: grab;
}

.inventory-item[draggable="true"]:active {
    cursor: grabbing;
}

/* Prevent images from being dragged separately */
.inventory-item[draggable="true"] img {
    -webkit-user-drag: none;
    user-drag: none;
    pointer-events: none;
}

/* Ghost element for custom drag */
.pocket-drag-ghost {
    width: 80px;
    height: 80px;
    border-radius: 4px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

/* Delete button must be clickable */
.inventory-item .pocket-item-delete {
    pointer-events: auto;
}

.inventory-item.image-item {
    width: 150px;
    height: 150px;
    object-fit: cover;
}

.inventory-item.pdf-item-large {
    width: 150px;
    height: 150px;
    box-shadow: none;
    overflow: visible;
}

.inventory-item.single-glow.pdf-item-large {
    width: 120px;
    min-height: 140px;
    box-shadow: none;
}

.inventory-item-pdf-large {
    width: 100%;
    height: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    background: transparent;
}

.inventory-item-pdf-title {
    font-size: 8px;
    font-weight: bold;
    color: white;
    text-align: center;
    margin-bottom: 5px;
    line-height: 1.1;
    max-width: 80px;
    word-wrap: break-word;
}

.inventory-item-pdf-cover-large {
    width: 60px;
    height: 75px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
    background: transparent;
}

/* Album item styles */
.inventory-item.album-item {
    width: 150px;
    height: 150px;
    overflow: visible;
}

.inventory-item-album {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
    border-radius: 8px;
}

.inventory-item-album-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.inventory-item-album-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
    text-align: center;
    padding: 10px;
}

.inventory-item-album-badge {
    position: absolute;
    bottom: 6px;
    right: 6px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 4px;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.inventory-item-album-badge svg {
    stroke: white;
}

/* Voice memo thumbnail styling - matches text-item */
.inventory-item-voice {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 12px;
    gap: 8px;
    height: 100%;
    box-sizing: border-box;
}

.inventory-item-voice-title {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.4;
    max-width: 130px;
    word-wrap: break-word;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.inventory-item-voice-play {
    color: rgba(255, 255, 255, 0.6);
    margin: 4px 0;
}

.inventory-item-voice-play svg {
    width: 28px;
    height: 28px;
}

.inventory-item-voice-duration {
    font-size: 10px;
    font-style: italic;
    color: rgba(255, 255, 255, 0.4);
}

.inventory-item-pdf-cover-large img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.inventory-pdf-cover-canvas {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.inventory-item-pdf-label-large {
    font-size: 8px;
    font-weight: bold;
    color: white;
    text-transform: lowercase;
    line-height: 1.1;
    text-align: center;
}

/* Single item PDF styling */
.inventory-content.single-item .inventory-item-pdf-title {
    font-size: 12px;
    max-width: 120px;
    margin-bottom: 8px;
}

.inventory-content.single-item .inventory-item-pdf-cover-large {
    width: 90px;
    height: 110px;
    margin-bottom: 8px;
}

.inventory-content.single-item .inventory-item-pdf-label-large {
    font-size: 12px;
}

.inventory-item.text-item {
    width: 150px;
    height: 150px;
    box-shadow: none;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
}

.inventory-item.single-glow {
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.8);
}

.inventory-item.single-glow.image-item {
    max-width: 160px;
    max-height: 160px;
}

/* Text items should not have glow even when single */
.inventory-item.single-glow.text-item {
    box-shadow: none;
}

.inventory-item:hover {
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.9);
}

/* Text items should not have glow on hover either */
.inventory-item.text-item:hover {
    transform: scale(1.1);
    box-shadow: none;
}

.inventory-item.single-glow:hover {
    transform: scale(1.15);
    box-shadow: 0 0 25px rgba(255, 255, 255, 1);
}

/* Override hover glow for single text items too */
.inventory-item.single-glow.text-item:hover {
    transform: scale(1.15);
    box-shadow: none;
}

.inventory-item.enlarged {
    transform: scale(4);
    z-index: 280;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.inventory-item-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: transparent;
}

/* New text item styling - no background, just text */
.inventory-item-text-preview {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    padding: 10px;
    color: white !important;
    text-align: center;
    line-height: 1.2;
    font-weight: bold;
    word-wrap: break-word;
    overflow: hidden;
    position: relative;
}

/* Force white color on ALL nested elements in text preview */
.inventory-item-text-preview * {
    color: white !important;
}

/* Smooth fade-in for lazy-loaded images */
.inventory-item-image.lazy-image {
    opacity: 0.3;
    transition: opacity 0.3s ease;
}

.inventory-item-image.lazy-image.loaded,
.inventory-item-image.cached {
    opacity: 1;
}

/* Single item text styling */
.inventory-content.single-item .inventory-item.text-item {
    width: 100%;
    aspect-ratio: 16 / 9;
    height: auto;
}

.inventory-content.single-item .inventory-item-text-preview {
    width: 100%;
    height: 100%;
    color: white !important;
    padding: 20px;
}

.inventory-item-pdf {
    width: 100%;
    height: auto;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: flex-start;
    position: relative;
    background: transparent;
}

.inventory-item-pdf-cover {
    width: 100%;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2px;
}

.inventory-item-pdf-cover img {
    width: 100%;
    height: auto;
    object-fit: contain;
}

.inventory-item-pdf-label {
    font-size: 5px;
    font-weight: normal;
    color: white;
    text-transform: lowercase;
    line-height: 1;
    align-self: flex-end;
}

/* Enlarged item overlay */
.enlarged-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    z-index: 270;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.enlarged-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.inventory-content.viewing-item .inventory-item {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.inventory-enlarged-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
    z-index: 260;
}

.inventory-enlarged-image.visible {
    opacity: 1;
    pointer-events: auto;
}

.inventory-enlarged-image img {
    max-width: 85%;
    max-height: 85%;
    object-fit: contain;
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.5);
    z-index: 265;
    position: relative;
}

/* Landscape corner labels - hidden by default, only show in landscape */
.landscape-channel-name {
    display: none;
}

/* UPDATED: Show landscape name only on mobile devices in landscape */
@media screen and (orientation: landscape) and (max-width: 1024px) {
    .landscape-channel-name {
        display: block !important;
    }
}

/* UPDATED: Enhanced landscape mode display - ONLY ON MOBILE DEVICES */
@media screen and (orientation: landscape) and (max-width: 1024px) {
    /* Hide the entire inventory overlay and all its contents in landscape */
    .inventory-overlay {
        display: none !important;
    }

    .inventory-content {
        display: none !important;
    }

    .inventory-backdrop {
        display: none !important;
    }

    /* Hide ALL opened inventory items instantly in landscape */
    .inventory-enlarged-image {
        display: none !important;
    }

    .enlarged-overlay {
        display: none !important;
    }

    .enlarged-content {
        display: none !important;
    }

    .image-close-area {
        display: none !important;
    }

    /* Hide text items instantly too */
    .text-display-overlay {
        display: none !important;
    }

    .text-display-background {
        display: none !important;
    }

    /* Hide existing UI elements in landscape */
    .channel-avatar-container,
    .antenna-dot,
    .header-info,
    .mobile-controls,
    .typo-controls,
    .age-daily,
    .title-blocker,
    .bottom-blocker,
    .channel-info-display {
        display: none !important;
    }

    /* Landscape channel name in upper-right corner */
    .landscape-channel-name {
        position: fixed !important;
        top: 20px !important;
        right: 20px !important;
        color: var(--channel-accent) !important;
        font-size: 18px !important;
        font-family: Arial, sans-serif !important;
        z-index: 300 !important;
        display: block !important;
        text-shadow: 0 0 10px rgba(0, 0, 0, 0.8) !important;
    }

    /* Global channel landscape stage: hide ALL overlays — just show the video */
    .global-channel-active:not(.safari-entry-mode) .landscape-channel-name,
    .global-channel-active:not(.safari-entry-mode) .channel-source-tag,
    .global-channel-active:not(.safari-entry-mode) .channel-source-tag.visible,
    .global-channel-active:not(.safari-entry-mode) .age-daily,
    .global-channel-active:not(.safari-entry-mode) .mobile-nav-buttons,
    .global-channel-active:not(.safari-entry-mode) .mobile-tv-controls,
    .global-channel-active:not(.safari-entry-mode) .mobile-stage-door,
    .global-channel-active:not(.safari-entry-mode) .global-channel-title,
    .global-channel-active:not(.safari-entry-mode) .channel-info-source,
    .global-channel-active:not(.safari-entry-mode) .channel-info-name,
    .global-channel-active:not(.safari-entry-mode) .channel-info-location,
    .global-channel-active:not(.safari-entry-mode) .channel-info-links,
    .global-channel-active:not(.safari-entry-mode) .channel-info-display,
    .global-channel-active:not(.safari-entry-mode) .safari-channel-tabs,
    .global-channel-active:not(.safari-entry-mode) .episode-title,
    .global-channel-active:not(.safari-entry-mode) .swipe-overlay {
        display: none !important;
    }

    /* Global channel landscape shop */
    body.safari-entry-mode .maintained-by,
    body.safari-entry-mode .contact-email {
        display: none !important;
    }

    /* Move b.2026 just below Age Daily */
    body.safari-entry-mode .shop-established {
        display: block !important;
        position: fixed !important;
        top: auto !important;
        bottom: auto !important;
        left: 15px !important;
        right: auto !important;
        top: 45px !important;
        font-size: 10px !important;
    }

    /* Catalog: all items on one row, left-aligned */
    body.safari-entry-mode .safari-catalog {
        left: 15px !important;
        transform: none !important;
        right: auto !important;
    }
    body.safari-entry-mode .safari-catalog-covers {
        justify-content: flex-start !important;
    }
    /* Reorder: John Tottenham(1), Ubu Roi(2), COMPACT(3), frozengirl(4) */
    body.safari-entry-mode .safari-catalog-covers .safari-catalog-cover:nth-child(1) { order: 1; }
    body.safari-entry-mode .safari-catalog-covers .safari-catalog-cover:nth-child(2) { order: 4; }
    body.safari-entry-mode .safari-catalog-covers .safari-catalog-cover:nth-child(3) { order: 3; }
    body.safari-entry-mode .safari-catalog-covers .safari-catalog-cover:nth-child(4) { order: 2; }
    
    /* Channel source tag in lower right corner (landscape, global channel only) */
    .channel-source-tag {
        position: fixed !important;
        bottom: 20px !important;
        right: 20px !important;
        color: white !important;
        font-size: 14px !important;
        z-index: 300 !important;
        display: none !important;
        text-shadow: 0 0 10px rgba(0, 0, 0, 0.8) !important;
        pointer-events: auto !important;
    }
    
    .channel-source-tag.visible {
        display: block !important;
    }
    body.screening-active .channel-source-tag.visible {
        display: none !important;
    }
    
    .source-via {
        font-weight: 300;
        opacity: 0.8;
    }
    
    .source-channel-name {
        font-weight: bold;
        cursor: pointer;
    }
}

/* Optional: Hide landscape-only elements on desktop */
@media screen and (min-width: 1025px) {
    .landscape-channel-name {
        display: none !important;
    }
    
    /* Hide channel source tag in landscape position on desktop */
    .channel-source-tag {
        display: none !important;
    }
}

/* Channel source tag - default hidden, shown only in landscape on global channel */
.channel-source-tag {
    display: none !important;
    position: fixed;
    bottom: 20px;
    right: 20px;
    color: white;
    font-size: 14px;
    z-index: 300;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.8);
    pointer-events: auto;
}

.channel-source-tag .source-via {
    font-weight: 300;
    opacity: 0.8;
}

.channel-source-tag .source-channel-name {
    font-weight: bold;
    cursor: pointer;
}

/* Maintained by - visible on global channel */
.maintained-by {
    display: none;
    position: fixed;
    bottom: 40px;
    right: 20px;
    color: white;
    font-family: Arial, sans-serif;
    font-size: 12px;
    z-index: 300;
    pointer-events: auto;
}

@media screen and (min-width: 769px) {
    body.global-channel-active .maintained-by {
        display: block;
    }
}

.maintained-by span {
    opacity: 0.8;
}

/* Contact email - below maintained-by by default, repositions in shop mode */
.contact-email {
    display: none;
    position: fixed;
    bottom: 25px;
    right: 20px;
    font-family: Arial, sans-serif;
    font-size: 12px;
    z-index: 300;
    pointer-events: auto;
}

body.global-channel-active .contact-email {
    display: block;
}

.shop-tagline-line1 {
    display: none;
    position: fixed;
    bottom: 60px;
    right: 40px;
    font-family: Arial, sans-serif;
    font-size: 12px;
    color: white;
    opacity: 0.8;
    z-index: 300;
    pointer-events: auto;
    text-align: right;
    user-select: text;
    -webkit-user-select: text;
    cursor: text;
}

.shop-tagline-line2 {
    display: none;
    position: fixed;
    bottom: 40px;
    right: 40px;
    font-family: Arial, sans-serif;
    font-size: 12px;
    color: white;
    opacity: 0.8;
    z-index: 300;
    pointer-events: auto;
    text-align: right;
    user-select: text;
    -webkit-user-select: text;
    cursor: text;
}

body.safari-entry-mode .shop-tagline-line1,
body.safari-entry-mode .shop-tagline-line2 {
    display: block;
}

/* Keep email below maintained-by when shop is open */
body.shop-open .contact-email {
    bottom: 25px;
    right: 20px;
}

.contact-email a {
    color: white;
    opacity: 0.8;
    text-decoration: none;
}

.contact-email a:hover {
    text-decoration: underline;
}

/* Shop opens notice - positioned inside shop overlay */
.shop-opens-notice {
    position: fixed;
    bottom: 10px;
    right: 20px;
    font-family: Arial, sans-serif;
    font-size: 12px;
    color: white;
    opacity: 0.8;
    z-index: 9999;
    pointer-events: none;
}

/* Mention links - @username style */
.mention-link {
    color: white;
    font-weight: bold;
    text-decoration: none;
    cursor: pointer;
}

.mention-link:hover {
    text-decoration: underline;
}

.enlarged-content {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 80vw;
    max-height: calc(100vh - 200px);
    z-index: 285;
    opacity: 0;
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.enlarged-content.visible {
    opacity: 1;
    pointer-events: auto;
}

.enlarged-content img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.5);
}

.enlarged-content .image-content {
    display: flex;
    align-items: center;
    justify-content: center;
}

.enlarged-content .image-content img {
    max-width: 90vw;
    max-height: calc(100vh - 200px);
}

.enlarged-content .image-content.horizontal {
    position: fixed;
    top: 180px;
    left: 50%;
    transform: translateX(-50%);
    width: 85vw;
    height: auto;
}

.enlarged-content .image-content.horizontal img {
    width: 100%;
    height: auto;
    max-height: calc(100vh - 300px);
}

.enlarged-content .text-content {
    background: rgba(255, 255, 255, 0.95);
    color: #333;
    padding: 20px 40px;
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.5);
    max-width: 80vw;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
    font-size: 16px;
    line-height: 1.6;
    width: 70vw;
    min-height: 200px;
}

.enlarged-content .pdf-content {
    background: rgba(255, 255, 255, 0.95);
    color: #333;
    padding: 40px;
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.5);
    text-align: center;
}

/* Text display overlay */
.text-display-overlay {
    position: fixed;
    top: 90px;
    left: 50px;
    right: 50px;
    background: transparent;
    z-index: 270;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
    overflow: visible;
    height: auto;
    max-height: calc(100vh - 230px);
}

.text-display-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.text-display-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    z-index: 265;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.text-display-background.visible {
    opacity: 1;
    pointer-events: auto;
}

/* Expanded clickable area for images */
.image-close-area {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    z-index: 260;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.image-close-area.visible {
    opacity: 1;
    pointer-events: auto;
}

.text-display-content {
    width: 100%;
    height: auto;
    min-height: 100px;
    max-height: calc(100vh - 230px);
    padding: 20px;
    overflow-y: auto;
    background: transparent;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.text-display-content::-webkit-scrollbar {
    display: none;
}

.text-display-text {
    color: white;
    font-size: 16px;
    line-height: 1.6;
    text-align: justify;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.8),
                 0 0 12px rgba(255, 255, 255, 0.6),
                 0 0 16px rgba(255, 255, 255, 0.4);
    background: transparent;
}

.text-display-title {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 20px;
    color: white;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.9),
                 0 0 15px rgba(255, 255, 255, 0.7),
                 0 0 20px rgba(255, 255, 255, 0.5);
}

/* Item viewer modal */
.item-viewer {
    display: none;
}

.empty-inventory {
    color: var(--channel-accent);
    text-align: center;
    padding: 40px;
    font-size: 16px;
    grid-column: 1 / -1;
    position: relative;
    z-index: 2;
}

.header-info {
    position: fixed;
    top: 10px;
    left: 10px;
    right: 90px;
    color: var(--channel-accent);
    font-size: 16px;
    z-index: 200;
    background: rgba(0,0,0,0.8);
    padding: 10px;
    border-radius: 8px;
    text-align: center;
    transition: opacity 0.3s ease, transform 0.3s ease;
    display: none;
    opacity: 0;
    transform: translateY(-20px);
}

.header-info.visible {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.header-info h1 {
    margin: 0;
    font-size: 24px;
    text-decoration: underline;
}

.header-info .bio {
    font-size: 14px;
    margin-top: 10px;
}

.header-info a {
    color: var(--channel-accent);
    text-decoration: underline;
}

/* Channel links in descriptions (e.g., @stephen, @jos in collab channels) */
.channel-link {
    color: inherit;
    text-decoration: none;
}

.channel-link:hover {
    text-decoration: underline;
}

/* Global channel header styling */
.header-info.global-channel {
    color: gold;
}

.header-info.global-channel h1 {
    color: gold;
}

.header-info.global-channel a {
    color: gold;
}

/* Mobile controls */
.mobile-controls {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0,0,0,0.9);
    padding: 15px;
    display: none;
    justify-content: space-around;
    align-items: center;
    z-index: 200;
}

.control-btn {
    background: var(--channel-accent);
    color: white;
    border: none;
    padding: 15px;
    border-radius: 50%;
    font-size: 20px;
    width: 60px;
    height: 60px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.control-btn:active {
    background: darkred;
}

/* Shop coming soon message */
.shop-coming-soon {
    position: fixed;
    top: 15px;
    left: 15px;
    color: white;
    font-family: Arial, sans-serif;
    font-size: 14px;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.shop-coming-soon.visible {
    opacity: 1;
}

/* Global channel login key icon - hidden by default */
.global-login-key {
    display: none;
    position: fixed;
    top: 80px;
    right: 20px;
    color: white;
    cursor: pointer;
    z-index: 201;
    opacity: 0.7;
}

.global-login-key svg {
    width: 22px;
    height: 22px;
}

/* Show key on global channel when not logged in (all screen sizes for portrait) */
.global-channel-active .global-login-key {
    display: block;
}

.owner-logged-in .global-login-key {
    display: none !important;
}

/* Hide key in landscape mode */
@media screen and (orientation: landscape) {
    .global-login-key {
        display: none !important;
    }
}

/* Mobile mute icon - hidden by default (shown on mobile only) */
.mobile-mute-icon {
    display: none;
}

/* Mute icon states */
.mobile-mute-icon .mute-icon-muted {
    display: block;
}
.mobile-mute-icon .mute-icon-unmuted {
    display: none;
}
body.user-unmuted .mobile-mute-icon .mute-icon-muted {
    display: none;
}
body.user-unmuted .mobile-mute-icon .mute-icon-unmuted {
    display: block;
}

/* Mobile channel navigation arrows */
.mobile-channel-arrows {
    display: none;
}

/* Mobile skip arrow */
.mobile-skip-arrow {
    display: none;
}

@media screen and (max-width: 1024px) and (orientation: portrait) {
    /* Login key icon - below Age Daily on global channel */
    .global-login-key {
        display: none;
        position: fixed;
        top: 80px;
        right: 20px;
        color: white;
        cursor: pointer;
        z-index: 201;
        opacity: 0.7;
        transition: opacity 0.2s;
    }

    .global-login-key:active {
        opacity: 1;
    }

    .global-login-key svg {
        width: 22px;
        height: 22px;
    }

    /* Key icon hidden on mobile - replaced by text login button */
    /* (Rules for showing key icon removed - using mobile-nav-buttons login instead) */

    /* Hide channel arrows on mobile - minimal UI */
    .mobile-channel-arrows {
        display: none !important;
    }

    /* Hide skip arrow on mobile - minimal UI */
    .mobile-skip-arrow {
        display: none !important;
    }

    /* Hide all typo buttons except mobile index */
    #typoSkipBtn,
    #typoPauseBtn,
    #typoMuteBtn {
        display: none !important;
    }

    /* Hide typo-controls on mobile - replaced by mobile-nav-buttons */
    .typo-controls {
        display: none !important;
    }

    /* Hide old mobile mute icon - replaced by text button */
    .mobile-mute-icon {
        display: none !important;
    }

    /* Hide homeIndexButtons on mobile - use mobile-nav-buttons instead */
    #homeIndexButtons {
        display: none !important;
    }

    /* Hide login button on mobile - using mobile-nav-buttons instead */
    #typoLoginBtn {
        display: none !important;
    }

    /* Hide shop button on mobile */
    #typoShopBtn {
        display: none !important;
    }

    /* Hide original index button on mobile */
    #typoIndexBtn {
        display: none !important;
    }

    /* Hide old mobile index button - replaced by mobile-nav-buttons */
    .typo-btn-mobile-index {
        display: none !important;
    }

    /* Hide original home button on mobile */
    #typoHomeBtn {
        display: none !important;
    }

    /* Hide mobile home button - minimal UI */
    .typo-btn-mobile-home {
        display: none !important;
    }

    /* Hide global login key icon - replaced by text button */
    .global-login-key {
        display: none !important;
    }

    /* Mobile text navigation buttons — bottom */
    .mobile-nav-buttons {
        display: flex !important;
        position: fixed;
        bottom: 25px;
        left: 15px;
        right: 15px;
        justify-content: space-between;
        align-items: center;
        z-index: 200;
        pointer-events: none;
    }

    .mobile-nav-left {
        display: flex;
        gap: 10px;
        align-items: center;
    }

    .mobile-nav-btn {
        -webkit-appearance: none;
        -moz-appearance: none;
        appearance: none;
        background: transparent;
        color: var(--channel-accent, #c41e3a);
        border: 1px solid var(--channel-accent, #c41e3a);
        padding: 6px 14px;
        border-radius: 3px;
        font-size: 13px;
        font-family: Arial, sans-serif;
        cursor: pointer;
        text-transform: lowercase;
        pointer-events: auto;
        opacity: 0.9;
    }

    .mobile-nav-btn:active {
        opacity: 1;
        background: rgba(255, 255, 255, 0.1);
    }

    /* Hide login button when logged in */

    .mobile-stage-door {
        display: none;
        position: fixed;
        top: 12px;
        right: 15px;
        z-index: 200;
        font-size: 10px;
        padding: 4px 10px;
        background: none;
        color: rgba(255,255,255,0.3);
        border: 1px solid rgba(255,255,255,0.15);
        border-radius: 4px;
        cursor: pointer;
        font-family: Georgia, serif;
        pointer-events: auto;
    }
    .global-channel-active .mobile-stage-door {
        color: #c41e3a;
        border-color: rgba(196,30,58,0.3);
    }

    /* Global channel uses red color */
    .global-channel-active .mobile-nav-btn {
        color: #c41e3a;
        border-color: #c41e3a;
    }

    /* Mobile TV controls - vertical stack on right side */
    .mobile-tv-controls {
        display: flex !important;
        flex-direction: column;
        position: fixed;
        right: 15px;
        top: 50%;
        transform: translateY(-50%);
        gap: 8px;
        z-index: 200;
        pointer-events: none;
    }

    .mobile-tv-btn {
        -webkit-appearance: none;
        -moz-appearance: none;
        appearance: none;
        background: transparent;
        color: var(--channel-accent, #c41e3a);
        border: 1px solid var(--channel-accent, #c41e3a);
        width: 40px;
        height: 40px;
        border-radius: 3px;
        font-size: 16px;
        font-family: Arial, sans-serif;
        cursor: pointer;
        pointer-events: auto;
        opacity: 0.7;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .mobile-tv-btn:active {
        opacity: 1;
        background: rgba(255, 255, 255, 0.1);
    }

    /* Global channel uses red color for TV controls */
    .global-channel-active .mobile-tv-btn {
        color: #c41e3a;
        border-color: #c41e3a;
    }

    /* Hide TV controls when not on TV tab or during overlays */
    body:has(.pocket-viewing-overlay.active) .mobile-tv-controls,
    body:has(.notes-viewing-overlay.active) .mobile-tv-controls,
    body:has(.login-overlay.active) .mobile-tv-controls,
    body:has(.channel-index-overlay.visible) .mobile-tv-controls,
    body:has(.inventory-overlay.visible) .mobile-tv-controls,
    body.screening-active .mobile-tv-controls,
    body.safari-entry-mode .mobile-tv-controls {
        display: none !important;
    }

    /* Hide TV controls when pocket/shop/notes tabs are active */
    body.safari-channel-pocket-mode .mobile-tv-controls,
    body.mobile-global-tabs:not(.mobile-tv-tab-active) .mobile-tv-controls {
        display: none !important;
    }

    /* Hide mobile nav buttons during overlays and viewing modes */
    /* Note: NOT hiding during channel-index-overlay so user can tap index again to close */
    /* Note: NOT hiding during screening-active so user can mute/index/home */
    body:has(.pocket-viewing-overlay.active) .mobile-nav-buttons,
    body:has(.notes-viewing-overlay.active) .mobile-nav-buttons,
    body:has(.login-overlay.active) .mobile-nav-buttons,
    body.safari-entry-mode .mobile-nav-buttons {
        display: none !important;
    }

    /* Force show mobile controls on individual channels (direct channel links) */
    /* This overrides the global-tabs hiding rule for non-global channels */
    html.direct-channel-link:not(.global-channel-active) .mobile-nav-buttons,
    html.direct-channel-link:not(.global-channel-active) .mobile-tv-controls {
        display: flex !important;
    }

    /* Still hide during actual overlay/viewing states on direct channel links */
    /* Note: NOT hiding mobile-nav-buttons during channel-index so user can tap index again to close */
    html.direct-channel-link body:has(.pocket-viewing-overlay.active) .mobile-nav-buttons,
    html.direct-channel-link body:has(.pocket-viewing-overlay.active) .mobile-tv-controls,
    html.direct-channel-link body:has(.notes-viewing-overlay.active) .mobile-nav-buttons,
    html.direct-channel-link body:has(.notes-viewing-overlay.active) .mobile-tv-controls,
    html.direct-channel-link body:has(.login-overlay.active) .mobile-nav-buttons,
    html.direct-channel-link body:has(.login-overlay.active) .mobile-tv-controls,
    html.direct-channel-link body:has(.channel-index-overlay.visible) .mobile-tv-controls,
    html.direct-channel-link body:has(.inventory-overlay.visible) .mobile-tv-controls {
        display: none !important;
    }

    /* FORCE show mobile nav buttons in pocket mode - must come AFTER hiding rules */
    /* These buttons should always be visible when viewing the pocket grid */
    html.direct-channel-link body.safari-channel-pocket-mode .mobile-nav-buttons,
    html.direct-channel-link body:has(.inventory-overlay.visible) .mobile-nav-buttons,
    body.mobile-global-tabs.safari-channel-pocket-mode .mobile-nav-buttons,
    body.mobile-global-tabs:has(.inventory-overlay.visible) .mobile-nav-buttons {
        display: flex !important;
        z-index: 250;
    }

    /* Ensure mobile nav buttons use channel accent color in pocket mode */
    html.direct-channel-link body.safari-channel-pocket-mode .mobile-nav-btn,
    html.direct-channel-link body:has(.inventory-overlay.visible) .mobile-nav-btn,
    body.mobile-global-tabs.safari-channel-pocket-mode .mobile-nav-btn,
    body.mobile-global-tabs:has(.inventory-overlay.visible) .mobile-nav-btn {
        color: var(--channel-accent, #c41e3a);
        border-color: var(--channel-accent, #c41e3a);
    }

    /* Global channel title - top right on mobile, global channel only */
    html.global-channel-active .mobile-global-title {
        display: block;
        position: fixed;
        top: 55px;
        right: 20px;
        color: white;
        font-family: Arial, sans-serif;
        font-weight: bold;
        font-size: 18px;
        z-index: 200;
        pointer-events: none;
    }

    /* Hide pocket button when pocket is open on mobile */
    body:has(.pocket-viewing-overlay.active) .channel-info-pocket,
    body:has(.inventory-overlay.visible) .channel-info-pocket {
        display: none !important;
    }

    /* Nudge channel info up on mobile (except Caveh) */
    .channel-info-display:not(.caveh-active) {
        bottom: 75px !important;
    }

    /* Hide mobile channel arrows and skip when notebook or pocket (album) is open */
    body:has(.notes-viewing-overlay.active) .mobile-channel-arrows,
    body:has(.pocket-viewing-overlay.active) .mobile-channel-arrows,
    body:has(.notes-viewing-overlay.active) .mobile-skip-arrow,
    body:has(.pocket-viewing-overlay.active) .mobile-skip-arrow {
        display: none !important;
    }

    /* External link on mobile - hide the row, use mobile element instead */
    .channel-info-external-row {
        display: none !important;
    }

    /* Mobile external link styling - matches pocket styling */
    .channel-info-external-mobile {
        font-size: 12px;
        color: white;
        opacity: 0.8;
        cursor: pointer;
        pointer-events: auto;
        padding: 8px;
        margin: -8px;
        margin-left: 4px;
    }
}

/* Mobile global title - hidden by default, shown on mobile global channel only */
.mobile-global-title {
    display: none;
}

/* Mobile nav buttons - hidden by default, shown on mobile only */
.mobile-nav-buttons {
    display: none;
}

/* Mobile TV controls - hidden by default, shown on mobile only */
.mobile-tv-controls {
    display: none;
}

/* FORCE hide mobile elements on desktop - prevent glitches */
@media screen and (min-width: 1025px) {
    .mobile-nav-buttons,
    .mobile-tv-controls {
        display: none !important;
    }

    /* Keep typo-controls at bottom, never top */
    .typo-controls {
        top: auto !important;
        bottom: 55px !important;
    }
}

/* Typography controls */
.typo-controls {
    position: fixed;
    bottom: 55px;
    left: 10px;
    display: flex;
    gap: 8px;
    z-index: 200;
    max-width: 120px;
}

/* Mobile-only index button - hidden on desktop */
.typo-btn-mobile-index {
    display: none;
}

/* Mobile-only home button - hidden on desktop */
.typo-btn-mobile-home {
    display: none;
}

.typo-btn {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background: transparent;
    color: var(--channel-accent);
    border: 1px solid var(--channel-accent);
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-family: Arial, sans-serif;
    cursor: pointer;
    text-transform: lowercase;
    transition: background-color 0.2s ease;
    line-height: 1.2;
    box-sizing: border-box;
}

.typo-btn:active {
    background: color-mix(in srgb, var(--channel-accent) 10%, transparent);
}

/* Desktop/mobile text switching for buttons */
.desktop-text {
    display: inline;
}
.mobile-text {
    display: none;
}
@media screen and (max-width: 768px) {
    .desktop-text {
        display: none;
    }
    .mobile-text {
        display: inline;
    }
}

/* Collective canvas & pocket buttons - top left */
.collective-buttons {
    display: none;
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 200;
    align-items: center;
    gap: 6px;
}

/* Hide collective buttons when canvas or pocket is open */
body:has(.notes-viewing-overlay.active) .collective-buttons,
body:has(.inventory-overlay.visible) .collective-buttons,
body:has(.notes-viewing-overlay.active) .collective-buttons-mobile,
body:has(.inventory-overlay.visible) .collective-buttons-mobile {
    display: none !important;
}

/* Hide desktop collective buttons on mobile - use mobile version instead */
@media screen and (max-width: 768px) {
    .collective-buttons {
        display: none !important;
    }
}

.collective-label {
    color: white;
    font-size: 12px;
    font-family: Arial, sans-serif;
    text-transform: lowercase;
    margin-right: 4px;
}

.collective-btn {
    background: transparent;
    color: white;
    border: 1px solid white;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-family: Arial, sans-serif;
    cursor: pointer;
    text-transform: lowercase;
    transition: background-color 0.2s ease;
}

.collective-btn:active {
    background: rgba(255, 255, 255, 0.1);
}

.collective-separator {
    color: white;
    font-size: 12px;
    font-family: Arial, sans-serif;
}

/* Mobile collective pocket button - above home/index buttons, below via name */
.collective-buttons-mobile {
    display: none;
    position: fixed;
    bottom: 58px;
    right: 20px;
    z-index: 200;
}

.collective-btn-mobile {
    background: transparent;
    color: var(--channel-accent);
    border: 1px solid var(--channel-accent);
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-family: Arial, sans-serif;
    cursor: pointer;
    text-transform: lowercase;
    transition: background-color 0.2s ease;
}

.collective-btn-mobile:active {
    background: color-mix(in srgb, var(--channel-accent) 10%, transparent);
}

/* Hide collective mobile button in landscape and on desktop */
@media screen and (orientation: landscape),
       screen and (min-width: 769px) {
    .collective-buttons-mobile {
        display: none !important;
    }
}

/* Desktop logout button - right of channel nav arrows, visible when logged in */
.desktop-logout {
    display: none;
    position: fixed;
    bottom: 25px;
    left: 235px;
    z-index: 200;
}

@media screen and (min-width: 1025px) {
    .desktop-logout.visible {
        display: block;
    }
}

/* Channel navigation arrows - desktop only */
.channel-nav-arrows {
    display: none;
}

@media screen and (min-width: 1025px) {
    .channel-nav-arrows {
        display: flex;
        flex-direction: column;
        gap: 2px;
        position: fixed;
        bottom: 25px;
        left: 200px;
        z-index: 200;
    }

    .arrow-key-btn {
        width: 24px;
        height: 20px;
        background: transparent;
        border: 1px solid var(--channel-accent);
        border-radius: 3px;
        color: var(--channel-accent);
        font-size: 10px;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: background-color 0.2s ease;
    }

    .arrow-key-btn:active {
        background: color-mix(in srgb, var(--channel-accent) 10%, transparent);
    }
}

/* Directory */
.directory {
    position: fixed;
    bottom: 100px;
    right: 10px;
    color: var(--channel-accent);
    font-size: 18px;
    background: rgba(0,0,0,0.8);
    padding: 10px;
    border-radius: 8px;
    z-index: 200;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.directory:active {
    background: rgba(0,0,0,0.9);
}

/* Directory dropdown */
.directory-dropdown {
    position: fixed;
    bottom: 160px;
    right: 10px;
    width: 200px;
    max-height: 300px;
    background: rgba(0,0,0,0.9);
    border-radius: 8px;
    z-index: 199;
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
    transition: all 0.3s ease;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--channel-accent) transparent;
}

.directory-dropdown::-webkit-scrollbar {
    width: 6px;
}

.directory-dropdown::-webkit-scrollbar-track {
    background: transparent;
}

.directory-dropdown::-webkit-scrollbar-thumb {
    background: var(--channel-accent);
    border-radius: 3px;
}

.directory-dropdown.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.directory-item {
    color: var(--channel-accent);
    font-size: 16px;
    padding: 12px 15px;
    cursor: pointer;
    border-bottom: 1px solid color-mix(in srgb, var(--channel-accent) 20%, transparent);
    transition: background-color 0.2s ease;
}

.directory-item:last-child {
    border-bottom: none;
}

.directory-item:hover {
    background: color-mix(in srgb, var(--channel-accent) 10%, transparent);
}

.directory-item:active {
    background: color-mix(in srgb, var(--channel-accent) 20%, transparent);
}

.directory-item.current {
    background: color-mix(in srgb, var(--channel-accent) 15%, transparent);
    font-weight: bold;
}

/* Global channel directory item styling */
.directory-item.global-channel {
    color: gold;
    border-bottom: 1px solid rgba(255, 215, 0, 0.2);
}

.directory-item.global-channel:hover {
    background: rgba(255, 215, 0, 0.1);
}

.directory-item.global-channel:active {
    background: rgba(255, 215, 0, 0.2);
}

.directory-item.global-channel.current {
    background: rgba(255, 215, 0, 0.15);
}

.age-daily {
    position: fixed;
    bottom: 100px;
    left: 10px;
    color: var(--channel-accent);
    font-size: 18px;
    background: rgba(0,0,0,0.8);
    padding: 10px;
    border-radius: 8px;
    z-index: 350;
    opacity: 0; /* Start hidden - JS will show when appropriate */
    cursor: pointer;
}

/* Hide " | TV" suffix on global channel */
html.global-channel-active .age-daily-tv-suffix {
    display: none;
}

/* Show age-daily when visible class added */
.age-daily.visible {
    opacity: 1;
}

/* Caveh folder title - centered on same line as age-daily */
.caveh-folder-title {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 18px;
    font-family: Arial, sans-serif;
    font-weight: bold;
    z-index: 350;
    pointer-events: none;
}

/* Caveh film titles below thumbnails */
.caveh-film-title {
    position: absolute;
    bottom: -20px;
    left: 0;
    right: 0;
    color: white;
    font-family: Arial, sans-serif;
    font-size: 12px;
    text-align: center;
    padding: 0 4px;
    line-height: 1.2;
}

.caveh-film-year {
    position: absolute;
    bottom: -36px;
    left: 0;
    right: 0;
    color: white;
    font-family: Arial, sans-serif;
    font-size: 12px;
    text-align: center;
    padding: 0 4px;
    line-height: 1.2;
}

/* Make video items with titles have room for the title and year */
.inventory-item.video-item:has(.caveh-film-title) {
    margin-bottom: 44px;
}

/* Swipe overlay */
.swipe-overlay {
    position: fixed;
    top: 80px;
    left: 0;
    right: 0;
    bottom: 120px;
    z-index: 150;
    background: transparent;
    touch-action: none;
}

/* Black bar to hide video title */
.title-blocker {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 80px; /* Increased from 60px */
    background: black;
    z-index: 100; /* Above video but below UI */
    pointer-events: auto; /* Block clicks */
}

/* Black bar to hide related videos at bottom */
.bottom-blocker {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100px;
    background: linear-gradient(to top, black 0%, black 83%, transparent 100%);
    z-index: 100; /* Above video but below UI */
    pointer-events: none;
}

/* Transparent blocker to prevent YouTube player clicks in bottom gap */
.bottom-blocker::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 120px;
    pointer-events: auto; /* Block clicks */
}

/* Hide bottom blocker during screening - it blocks the mic button */
body:has(.screening-overlay:not(.hidden)) .bottom-blocker,
body.screening-active .bottom-blocker {
    display: none !important;
}

/* Swipe overlay stays visible during screening to allow channel switching */
/* Video skipping is blocked via JS, but vertical swipes for channels still work */

/* Hide title blocker during screening */
body:has(.screening-overlay:not(.hidden)) .title-blocker,
body.screening-active .title-blocker {
    display: none !important;
}

/* Video Context Menu (right-click menu) */
.video-context-menu {
    position: fixed;
    background: rgba(20, 20, 20, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 6px 0;
    min-width: 180px;
    z-index: 10000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
}

.context-menu-item {
    padding: 10px 16px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    cursor: pointer;
    transition: background 0.15s;
}

.context-menu-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.context-menu-item.active {
    color: var(--channel-accent, #ff0000);
}

.context-menu-item.active::before {
    content: '✓ ';
}

.context-menu-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.15);
    margin: 6px 0;
}

/* Hide blockers when subtitles mode is active */
body.subtitles-mode .title-blocker,
body.subtitles-mode .bottom-blocker {
    opacity: 0 !important;
    pointer-events: none !important;
}

/* UPDATED: OLD landscape query for header-info - now restricted to mobile devices only */
@media screen and (orientation: landscape) and (max-width: 1024px) {
    .enlarged-overlay {
        display: none !important;
    }

    .channel-avatar-container,
    .antenna-dot,
    .header-info,
    .mobile-controls,
    .typo-controls,
    .age-daily, 
    #typoPressBtn,
    #typoIndexBtn {
        display: none !important;
    }
}
/* Hide avatar when channel index is visible */
.channel-index-overlay.visible ~ .channel-avatar-container {
    opacity: 0;
    pointer-events: none;
}

/* Show avatar when channel index is hidden */
.channel-index-overlay.hidden ~ .channel-avatar-container {
    opacity: 1;
    pointer-events: auto;
}

/* Black background only when viewing global channel */
.global-channel-active .channel-index-overlay.visible {
    background: rgba(0, 0, 0, 0.95);
}

/* Transparent background when not on global channel */
.channel-index-overlay.hidden {
    background: transparent;
}

/* FAST LOAD: Mobile-only - black background by default (starts on global channel) */
@media screen and (max-width: 1024px) {
    .channel-index-overlay {
        background: rgba(0, 0, 0, 0.95);
    }
}
@keyframes tvDistortion {
    0% {
        transform: scaleX(1.1) skewX(-3deg);
        letter-spacing: 3px;
        filter: blur(2px);
    }
    15% {
        transform: scaleX(0.95) skewX(2deg);
        letter-spacing: -1px;
        filter: blur(1px);
    }
    30% {
        transform: scaleX(1.05) skewX(-1deg);
        letter-spacing: 1px;
        filter: blur(0.5px);
    }
    50% {
        transform: scaleX(0.98) skewX(0.5deg);
        letter-spacing: 0px;
        filter: blur(0px);
    }
    100% {
        transform: scaleX(1) skewX(0deg);
        letter-spacing: 0px;
        filter: blur(0px);
    }
}
/* Enhanced channel avatar container with smooth transitions */
.channel-avatar-container {
    position: fixed;
    top: 60px;
    right: 20px;
    width: 60px;
    height: 60px;
    z-index: 250;
    cursor: pointer;
    /* UPDATED: Smooth transition for all properties including transform and opacity */
    transition: all 0.5s cubic-bezier(0.4, 0.0, 0.2, 1), 
                transform 0.5s cubic-bezier(0.4, 0.0, 0.2, 1),
                opacity 0.5s ease;
}

/* Smooth transition for blog mode */
.channel-avatar-container.blog-mode {
    opacity: 0 !important;
    pointer-events: none !important;
}


/* The actual avatar with smooth transitions */
.channel-avatar {
    position: fixed;
    top: 60px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border: 3px solid var(--channel-accent);
    z-index: 250;
    /* UPDATED: Smooth transition matching container */
    transition: all 0.5s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.channel-avatar.blog-mode {
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Antenna stems with smooth fade */
.channel-avatar-container::before,
.channel-avatar-container::after {
    content: '';
    position: absolute;
    width: 2px;
    height: 15px;
    background: var(--channel-accent);
    top: -15px;
    /* UPDATED: Smooth opacity transition */
    transition: opacity 0.4s ease;
}

.channel-avatar-container::before {
    left: 15px;
    transform: rotate(-20deg);
}

.channel-avatar-container::after {
    right: 15px;
    transform: rotate(20deg);
}

/* Hide antenna stems smoothly in blog mode */
.channel-avatar-container.blog-mode::before,
.channel-avatar-container.blog-mode::after {
    opacity: 0;
}

/* Antenna dots with smooth transitions */
.antenna-dot {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--channel-accent);
    border-radius: 50%;
    top: -19px;
    z-index: 251;
    opacity: 0; /* Start hidden - JS shows when appropriate */
    /* UPDATED: Smooth opacity transition */
    transition: opacity 0.4s ease;
}

.antenna-dot.left {
    left: 11px;
}

.antenna-dot.right {
    right: 11px;
}

.antenna-dot.hidden {
    opacity: 0;
}

/* Active click feedback - keep snappy */
.channel-avatar-container:active {
    transform: scale(0.95);
    transition: transform 0.1s ease;
}

/* Position global channel info lower - aligned with top typo controls */
.channel-info-display.global-channel {
    bottom: 55px; /* Same as typo-controls bottom position */
}
/* Navigation Instructions */
.nav-instructions {
    display: none;
}

.nav-instruction-line {
    opacity: 1;
    transition: opacity 0.5s ease;
}

.nav-instruction-line.hidden {
    opacity: 0;
}

/* Hide instructions in inventory mode */
.inventory-overlay.visible ~ .nav-instructions {
    opacity: 0;
}

/* Hide instructions when channel index is open */
.channel-index-overlay.visible ~ .nav-instructions {
    opacity: 0;
}

/* Hide instructions when viewing items */
.channel-avatar-container.item-viewing ~ .nav-instructions {
    opacity: 0;
}

/* Hide in landscape mode on mobile */
@media screen and (orientation: landscape) and (max-width: 1024px) {
    .nav-instructions {
        display: none !important;
    }
}

/* Desktop instructions - different text */
@media screen and (min-width: 1025px) {
    .nav-instructions {
        font-size: 12px;
    }
    
    /* Horizontal layout for channel info links on desktop */
    .channel-info-links {
        flex-direction: row;
        gap: 12px;
    }

    /* Desktop inventory grid - larger images with row gaps */
    .inventory-content {
        grid-template-columns: repeat(4, 1fr);
        gap: 20px 0px; /* row-gap column-gap */
        align-content: start;
        padding: 200px 40px 200px 40px;
        grid-auto-rows: 200px;
        overflow: visible;
        height: auto;
        min-height: 100%;
    }
    
    /* Items flow naturally into all 4 columns */
    .inventory-content .inventory-item {
        grid-column: auto;
    }
    
    /* Much larger images that fill cells and touch */
    .inventory-item.image-item {
        width: 100%;
        height: 200px; /* Reduced from 350px for faster loading */
        max-width: none;
        max-height: none;
        min-width: 0;
        min-height: 0;
        box-shadow: none;
    }
    
    .inventory-item-image {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    
    /* Remove hover effects that might add spacing */
    .inventory-item:hover {
        transform: none;
        box-shadow: none;
    }

    /* Remove extra margin from video items with titles */
    .inventory-item.video-item:has(.caveh-film-title) {
        margin-bottom: 0;
    }
    
    /* Larger PDFs for desktop */
    .inventory-item.pdf-item-large {
        width: 200px;
        min-height: 250px;
    }
    
    .inventory-item.single-glow.pdf-item-large {
        width: 250px;
        min-height: 300px;
    }
    
    .inventory-item-pdf-title {
        font-size: 14px;
        max-width: 200px;
    }
}
.channel-info-pocket {
    font-size: 12px;
    opacity: 0.8;
    text-decoration: underline;
    cursor: pointer;
    display: block;
    transition: opacity 0.3s ease;
    pointer-events: auto;
    position: relative;
    z-index: 250;
    padding: 8px;
    margin: -8px;
}

.channel-info-pocket:hover {
    opacity: 1;
}

.channel-info-pocket:active {
    transform: scale(0.95);
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.channel-info-pocket.item-viewing {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

/* Screening toggle button - appears below pocket/canvas links */
.channel-info-screening-toggle {
    font-size: 12px;
    opacity: 0.8;
    text-decoration: underline;
    cursor: pointer;
    display: block;
    transition: opacity 0.3s ease;
    pointer-events: auto;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    z-index: 250;
    padding: 8px;
    white-space: nowrap;
}

.channel-info-screening-toggle:hover {
    opacity: 1;
}

.channel-info-screening-toggle:active {
    transform: scale(0.95);
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

/* Caveh-specific links row - positioned below channel info */
.caveh-links {
    position: absolute;
    top: 100%;
    right: 0;
    display: none;
    gap: 16px;
    margin-top: 1px;
    pointer-events: auto;
}

/* External link - now shown in channel info, hide from avatar hover */
.avatar-hover-external-link {
    display: none !important;
}

/* Custom channel-specific links (e.g., Caveh's TV/Film) */
.channel-info-custom {
    font-size: 12px;
    opacity: 0.8;
    text-decoration: underline;
    cursor: pointer;
    position: relative;
    z-index: 250;
    padding: 8px;
    pointer-events: auto;
}

.channel-info-custom:hover {
    opacity: 1;
}

.channel-info-custom:active {
    transform: scale(0.95);
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

/* Desktop-specific: Simple fade for avatar transitions */
@media screen and (min-width: 1025px) {
    .channel-avatar-container {
        /* Remove position transitions on desktop - only fade */
        transition: opacity 0.3s ease !important;
    }
    
    .channel-avatar-container.blog-mode {
        /* Instant position change, only fade */
        transition: opacity 0.3s ease, 
                    top 0s, 
                    left 0s, 
                    right 0s, 
                    width 0s, 
                    height 0s !important;
    }
    
    .channel-avatar {
        /* Desktop: Only fade, no position animation */
        transition: opacity 0.3s ease !important;
    }
    
    .channel-avatar.blog-mode {
        /* Instant position change, only fade */
        transition: opacity 0.3s ease, 
                    border-radius 0.3s ease,
                    top 0s, 
                    left 0s, 
                    right 0s, 
                    width 0s, 
                    height 0s !important;
    }
    
    /* Remove the scale effect on active for desktop */
    .channel-avatar-container:active {
        transform: none !important;
    }
}


    }
}

}

.desktop-episode-title-line2 {
    display: block;
    margin-top: 4px;
}

/* Show desktop version only on desktop */
@media screen and (min-width: 1025px) {
    .mobile-now-playing {
        display: none !important;
    }
    
    .desktop-episode-title {
        display: block;
    }
}

/* OLD episode title in channel info - REMOVE */
.channel-episode-title {
    display: none !important;
}

/* ===== DESKTOP: Episode Title Display ===== */
/* Title appears in upper left corner */
.desktop-episode-title {
    position: fixed;
    left: 20px;
    top: 50%; transform: translateY(-50%);
    z-index: 300;
    color: white;
    font-size: 120px;
    font-style: italic;
    font-family: 'Times New Roman', Times, serif;
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
    max-width: calc(100vw - 200px);
    word-wrap: break-word;
    display: none;
}

.desktop-episode-title.visible {
    opacity: 1;
}

/* Episode number appears in channel info (lower right) */
.channel-episode-number {
    font-size: 18px;
    font-weight: bold;
    color: #fff;
    text-align: right;
    margin-top: 8px;
    display: none;
}

/* Show desktop version only on desktop */
@media screen and (min-width: 1025px) {
    .mobile-now-playing {
        display: none !important;
    }
    
    .desktop-episode-title {
        display: block;
    }
}

/* OLD episode title in channel info - REMOVE */
.channel-episode-title {
    display: none !important;
}

/* ===== MOBILE: Now Playing Display ===== */
/* ===== DESKTOP: Episode Title Display ===== */
.desktop-episode-title {
    position: fixed;
    left: 20px;
    top: 50%; transform: translateY(-50%);
    z-index: 300;
    color: white;
    font-size: 120px;
    font-style: italic;
    font-family: 'Times New Roman', Times, serif;
    line-height: 1.2;
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
    max-width: calc(100vw - 200px);
    word-wrap: break-word;
    display: none;
}

.desktop-episode-title.visible {
    opacity: 1;
}

.desktop-episode-line1 {
    display: block;
}

.desktop-episode-line2 {
    display: block;
}

/* Desktop-specific rules */
@media screen and (min-width: 1025px) {
    .mobile-now-playing {
        display: none !important;
    }
    
    .desktop-episode-title {
        display: block;
    }
    
    /* Hide channel info when index is open */
    body.index-open .channel-info-display {
        display: none !important;
    }
}

/* Remove old styles */
.channel-episode-title,
.channel-episode-number {
    display: none !important;
}

/* ==================== JOURNAL PRODUCT VIEW (DEMO) ==================== */
/* Matches safari-product-detail styling */
.journal-product-view {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: black;
    overflow: auto;
    z-index: 400;
}

/* Inner canvas for absolute positioning */
.journal-canvas {
    position: relative;
    min-width: 100%;
    min-height: 200vh; /* Allow scrolling */
    padding: 40px 20px;
}

.journal-product-view[style*="display: flex"] {
    display: flex !important;
}

.journal-product-view[style*="display: flex"] {
    display: flex !important;
}

/* Base journal element - all draggable */
.journal-element {
    position: absolute;
    z-index: 10;
}

/* Title */
.journal-el-title {
    left: 40px;
    top: 100px;
    width: 200px;
    font-family: Georgia, serif;
    font-size: 22px;
    color: white;
    line-height: 1.2;
}

.journal-el-description {
    left: 40px;
    top: 180px;
    width: 200px;
    font-family: Georgia, serif;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.6;
}

/* @caveh author link */
.journal-el-author {
    left: 40px;
    bottom: 40px;
    font-family: Arial, sans-serif;
    font-size: 14px;
    font-weight: bold;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
}

.journal-el-author:hover {
    color: white;
    text-decoration: underline;
}

/* Book info lines */
.journal-el-bookinfo1,
.journal-el-bookinfo2 {
    left: 280px;
    font-family: Georgia, serif;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.4;
}

.journal-el-bookinfo1 {
    top: calc(50% - 15px);
}

.journal-el-bookinfo2 {
    top: calc(50% + 10px);
}

/* Caveh Zahedi container */
.journal-el-caveh {
    left: 50%;
    top: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 4px;
    z-index: 50;
}

.journal-caveh-name {
    font-family: 'Times New Roman', Times, serif;
    font-style: italic;
    font-size: 36px;
    color: white;
    text-decoration: none;
}

.journal-caveh-name:hover {
    text-decoration: underline;
}

.journal-caveh-website {
    font-family: Arial, sans-serif;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
}

.journal-caveh-website a {
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
}

.journal-caveh-website a:hover {
    color: rgba(255, 255, 255, 0.7);
}

/* Age Daily logo on journal page */
.journal-el-agedaily {
    left: 50%;
    top: 300px;
    font-family: 'Times New Roman', Times, serif;
    font-style: italic;
    font-size: 72px;
    color: white;
    text-decoration: none;
    display: flex;
    z-index: 50;
}

.journal-el-agedaily:hover {
    opacity: 0.8;
}

/* Cover images container */
.journal-el-images {
    left: 50%;
    top: 20px;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding-bottom: 60px;
}

.journal-el-images img {
    max-width: 70vw !important;
    max-height: calc(100vh - 60px) !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
}

/* Individual image wrappers for dragging */
.journal-img-wrapper {
    position: absolute;
    z-index: 10;
    cursor: default;
}

.journal-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
}

/* When in editor mode, images become draggable */
.journal-editor-active .journal-img-wrapper {
    cursor: move;
}

/* Video thumbnails */
.journal-el-thumb {
    right: 40px;
    width: 120px;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.journal-el-thumb:nth-of-type(8) { top: calc(50% - 20px); }
.journal-el-thumb:nth-of-type(9) { top: calc(50% + 80px); }
.journal-el-thumb:nth-of-type(10) { top: calc(50% + 180px); }

.journal-el-thumb:hover {
    opacity: 1;
}

.journal-el-thumb img {
    width: 100%;
    height: auto;
    border-radius: 3px;
}

/* Scrollable image stack - center of page (legacy) */
.journal-product-images {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding-top: 20px;
    padding-bottom: 60px;
}

.journal-product-images img {
    max-width: 70vw !important;
    max-height: calc(100vh - 60px) !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
}

/* Info section - fixed left side */
.journal-product-info {
    position: fixed;
    left: 40px;
    top: 100px;
    bottom: 40px;
    width: 200px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 410;
}

/* Author link at bottom left of info box */
.journal-product-author-bottom {
    margin-top: auto;
}

.journal-product-author-bottom .author-link {
    font-family: Arial, sans-serif;
    font-size: 14px;
    font-weight: bold;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
}

.journal-product-author-bottom .author-link:hover {
    color: white;
    text-decoration: underline;
}

/* Book info - between cover and description, centered vertically */
.journal-book-info {
    position: fixed;
    left: 280px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 410;
    font-family: Georgia, serif;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.4;
}

.journal-product-title {
    font-family: Georgia, serif;
    font-size: 22px;
    color: white;
    line-height: 1.2;
}

.journal-product-author {
    font-family: Arial, sans-serif;
    font-weight: bold;
    font-size: 14px;
    color: white;
    margin-bottom: 10px;
}

.journal-product-description {
    font-family: Georgia, serif;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.6;
}

/* Price and cart styling */

.journal-product-price {
    font-family: Georgia, serif;
    font-size: 18px;
    color: white;
}

.journal-product-cart-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.5);
    color: white;
    font-family: 'Times New Roman', Times, serif;
    font-style: italic;
    font-size: 14px;
    padding: 10px 20px;
    cursor: pointer;
}

.journal-product-cart-btn:hover {
    border-color: white;
}

/* Author link styling */
.journal-product-author .author-link {
    color: inherit;
    text-decoration: none;
}

.journal-product-author .author-link:hover {
    font-weight: bold;
    text-decoration: underline;
}

/* Sidebar section - fixed right side */
.journal-product-sidebar {
    position: fixed;
    right: 40px;
    top: 50%;
    transform: translateY(-50%);
    width: 200px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    z-index: 410;
}

.journal-sidebar-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.journal-link {
    font-family: Arial, sans-serif;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
}

.journal-link:hover {
    color: white;
    text-decoration: underline;
}

/* Caveh Zahedi link styled like title */
.journal-link-title {
    font-family: Georgia, serif;
    font-size: 26px;
    color: white;
    line-height: 1.2;
    text-decoration: none;
}

.journal-link-title:hover {
    text-decoration: underline;
}

/* Video thumbnails in sidebar */
.journal-video-thumbs {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 15px;
}

.journal-video-thumb {
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.journal-video-thumb:hover {
    opacity: 1;
}

.journal-video-thumb img {
    width: 120px;
    height: auto;
    border-radius: 3px;
}

/* Close button for journal video playback */
.journal-video-close {
    position: fixed;
    top: 30px;
    right: 40px;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    color: white;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    z-index: 500;
    opacity: 0.7;
    transition: opacity 0.2s ease;
    display: none;
}

.journal-video-close:hover {
    opacity: 1;
}

/* ==================== JOURNAL LAYOUT EDITOR ==================== */
.journal-editor-toggle {
    position: fixed;
    bottom: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.7);
    padding: 6px 12px;
    font-size: 11px;
    cursor: pointer;
    z-index: 600;
    display: none;
}

/* Only show editor toggle when owner is logged in AND journal is open */
body.owner-mode.journal-view-open .journal-editor-toggle {
    display: block;
}

.journal-editor-toggle:hover {
    color: white;
    border-color: white;
}

.journal-editor-panel {
    position: fixed;
    bottom: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 15px;
    z-index: 600;
    min-width: 200px;
}

.journal-editor-title {
    color: white;
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 10px;
    cursor: move;
    user-select: none;
    padding: 5px;
    margin: -15px -15px 10px -15px;
    padding: 15px 15px 10px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.journal-editor-coords {
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    font-family: monospace;
    margin-bottom: 15px;
    line-height: 1.6;
    white-space: pre-line;
}

.journal-editor-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.7);
    padding: 6px 12px;
    font-size: 11px;
    cursor: pointer;
    margin-right: 8px;
    margin-top: 5px;
}

.journal-editor-btn:hover {
    color: white;
    border-color: white;
}

.journal-editor-tools,
.journal-editor-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 10px;
}

.journal-editor-fonts {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
    align-items: center;
}

.journal-editor-fonts select {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 4px 6px;
    font-size: 11px;
}

.journal-editor-fonts label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Draggable element styles when editor is active */
.journal-editor-active .journal-draggable,
.journal-editor-active .journal-element {
    cursor: move;
    outline: 1px dashed rgba(255, 255, 255, 0.3);
}

/* Custom images */
.journal-custom-image {
    position: absolute;
    z-index: 10;
}

.journal-custom-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.journal-editor-active .journal-dragging {
    outline: 2px solid white !important;
    z-index: 500 !important;
}

.journal-editor-active .journal-selected {
    outline: 2px solid rgba(100, 200, 255, 0.8) !important;
}

/* Resize handle */
.journal-resize-handle {
    position: absolute;
    bottom: -4px;
    right: -4px;
    width: 12px;
    height: 12px;
    background: rgba(100, 200, 255, 0.8);
    cursor: nwse-resize;
    display: none;
    z-index: 501;
}

.journal-selected .journal-resize-handle {
    display: block;
}

/* Custom text elements */
.journal-custom-text {
    position: absolute;
    font-family: Georgia, serif;
    font-size: 16px;
    color: white;
    padding: 5px;
    min-width: 50px;
    min-height: 20px;
    z-index: 10;
}

.journal-custom-text.editing {
    outline: 1px solid rgba(100, 200, 255, 0.5);
    cursor: text;
}

/* Custom video thumbs */
.journal-custom-video {
    position: absolute;
    cursor: pointer;
    z-index: 10;
}

.journal-custom-video img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 3px;
}

/* Individual video thumbs become draggable */
.journal-editor-active .journal-video-thumb {
    cursor: move;
    outline: 1px dashed rgba(255, 255, 255, 0.3);
    position: relative;
}

.journal-editor-active .journal-video-thumb.journal-selected {
    outline: 2px solid rgba(100, 200, 255, 0.8);
}

/* Purchase button - bottom right, aligned with thumbnails */
.journal-product-purchase {
    position: absolute;
    bottom: 40px;
    right: 40px;
    z-index: 10;
}

/* Hide other TV UI when journal view is open (keep tabs visible) */
body:has(.journal-product-view[style*="display: flex"]) .channel-info,
body:has(.journal-product-view[style*="display: flex"]) .header-info,
body:has(.journal-product-view[style*="display: flex"]) #mobileNowPlaying,
body:has(.journal-product-view[style*="display: flex"]) #desktopEpisodeTitle,
body:has(.journal-product-view[style*="display: flex"]) .collective-buttons {
    display: none !important;
}

/* Keep tabs above journal view - centered */
body:has(.journal-product-view[style*="display: flex"]) .safari-channel-tabs {
    display: flex !important;
    z-index: 500;
    left: 50%;
    transform: translateX(-50%);
}

/* Mobile journal view */
@media screen and (max-width: 768px) {
    .journal-product-info {
        position: relative;
        left: auto;
        top: auto;
        bottom: auto;
        width: 100%;
        padding: 20px;
    }

    .journal-product-sidebar {
        position: relative;
        right: auto;
        top: auto;
        transform: none;
        width: 100%;
        padding: 20px;
    }

    .journal-product-purchase {
        position: relative;
        top: auto;
        right: auto;
        transform: none;
        padding: 0 20px 20px 20px;
    }

    .journal-book-info {
        position: relative;
        left: auto;
        top: auto;
        transform: none;
        padding: 0 20px 20px 20px;
    }

    .journal-product-images img {
        max-width: 90vw;
    }
}

/* ==================== SHOP OVERLAY ==================== */
.shop-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 180;
    display: none;
    pointer-events: none;
}

.shop-overlay.visible {
    display: block;
}

/* Safari Desktop - hide channel index during entry mode, but allow when explicitly opened */
html.safari-desktop:not(.safari-tv-active) .channel-index-overlay:not(.visible) {
    display: none !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Safari Desktop - ensure channel index shows when explicitly opened */
html.safari-desktop .channel-index-overlay.visible {
    display: flex !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    z-index: 600 !important;
}

/* Hide the small "age daily | TV" badge immediately on Safari Desktop */
html.safari-desktop .age-daily {
    display: none !important;
}

/* Only show shop overlay on Safari Desktop for global/home page during entry mode, not profile pages */
/* Removed display: block !important to allow JavaScript toggle to work */
html.safari-desktop:not(.direct-channel-link) body.safari-entry-mode .shop-overlay {
    display: block !important;
    background: black;
    z-index: 250;
    pointer-events: auto;
}

/* Safari entry mode - shop overlay with black background */
.shop-overlay.safari-entry {
    background: black;
    z-index: 250;
    pointer-events: auto;
}

/* Hide navigation UI during Safari entry */
body.safari-entry-mode .channel-info-display,
body.safari-entry-mode .mobile-channel-arrows,
body.safari-entry-mode .mobile-skip-arrow,
body.safari-entry-mode .typo-controls,
body.safari-entry-mode #homeIndexButtons,
body.safari-entry-mode .owner-buttons,
body.safari-entry-mode .channel-index-overlay {
    display: none !important;
}

/* Hide the small "age daily | TV" badge during Safari entry */
body.safari-entry-mode .age-daily {
    display: none !important;
}

/* Safari entry tabs - shop/tv toggle */
.safari-entry-tabs {
    display: none;
    position: fixed;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 400;
    gap: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

/* Show entry tabs in shop mode - with hover behavior */
body.safari-entry-mode .safari-entry-tabs {
    display: flex;
}

body.safari-entry-mode:hover .safari-entry-tabs {
    opacity: 1;
    pointer-events: auto;
}

/* Hide channel tabs when shop is open */
/* Mobile: keep channel tabs in shop mode; Desktop: hide them */
@media screen and (min-width: 769px) {
    body.safari-entry-mode .safari-channel-tabs {
        display: none !important;
    }
}
@media screen and (max-width: 768px) {
    body.safari-entry-mode .safari-channel-tabs {
        display: flex !important;
        z-index: 10001;
    }
}

.safari-entry-tab {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
    font-weight: bold;
    padding: 8px 0;
    cursor: pointer;
    transition: color 0.2s ease;
    border-bottom: 2px solid transparent;
}

.safari-entry-tab:hover {
    color: rgba(255, 255, 255, 0.8);
}

.safari-entry-tab.active {
    color: white;
    border-bottom-color: white;
}

/* Channel tabs - for individual channels on desktop (TV / pocket / canvases) */
.safari-channel-tabs {
    display: none;
    position: fixed;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 400;
    gap: 20px;
}

/* Show on desktop for individual channels (not global) */
/* Use !important to override any inline styles that might be lingering */
html.safari-desktop.direct-channel-link .safari-channel-tabs,
body.safari-channel-mode .safari-channel-tabs {
    display: flex !important;
}

/* Hide when channel index is open (higher specificity) */
/* Desktop: hide channel tabs when index is open */
@media screen and (min-width: 769px) {
    body.safari-channel-mode.index-open .safari-channel-tabs,
    body.index-open .safari-channel-tabs {
        display: none !important;
    }
}

/* Keep channel tabs visible when viewing canvases */
body.safari-channel-mode:has(.notes-viewing-overlay.active) .safari-channel-tabs {
    display: flex !important;
    z-index: 500;
}

/* Hide channel tabs when shop overlay is open */
/* Mobile: keep channel tabs in shop mode; Desktop: hide them */
@media screen and (min-width: 769px) {
    body.safari-entry-mode .safari-channel-tabs {
        display: none !important;
    }
}
@media screen and (max-width: 768px) {
    body.safari-entry-mode .safari-channel-tabs {
        display: flex !important;
        z-index: 10001;
    }
}

/* Hide channel tabs in landscape mode on mobile */
@media screen and (max-height: 500px) and (orientation: landscape) {
    .safari-channel-tabs {
        display: none !important;
    }
}

.safari-channel-tab {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
    font-weight: bold;
    padding: 8px 0;
    cursor: pointer;
    transition: color 0.2s ease;
    border-bottom: 2px solid transparent;
}

.safari-channel-tab:hover {
    color: rgba(255, 255, 255, 0.8);
}

.safari-channel-tab.active {
    color: white;
    border-bottom-color: white;
}

/* Journal tab - two-line display (inactive state) */
.safari-channel-tab-journal {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    line-height: 1.2;
    padding-bottom: 8px;
}

.safari-channel-tab-journal span {
    display: block;
}

/* When active (showing "featured presentation"), align with other tabs */
.safari-channel-tab-journal.active {
    flex-direction: row;
    padding-bottom: 8px;
}


/* Safari channel tabs in white canvas mode */
body:has(.notes-viewing-overlay.white-bg) .safari-channel-tab {
    color: rgba(0, 0, 0, 0.5);
}

body:has(.notes-viewing-overlay.white-bg) .safari-channel-tab:hover {
    color: rgba(0, 0, 0, 0.8);
}

body:has(.notes-viewing-overlay.white-bg) .safari-channel-tab.active {
    color: #111;
    border-bottom-color: #111;
}

/* Mobile tabs for global channel only */
@media screen and (max-width: 768px) {
    /* Show tabs on mobile for global channel */
    body.mobile-global-tabs .safari-channel-tabs {
        display: flex !important;
        top: 15px;
        left: 15px;
        transform: none;
        gap: 15px;
    }

    body.mobile-global-tabs .safari-channel-tab {
        font-size: 13px;
        padding: 6px 0;
    }

    /* Hide tabs when in shop mode on mobile (shop overlay covers everything) */
    body.mobile-global-tabs.safari-entry-mode .safari-channel-tabs {
        z-index: 10001;
    }

    /* In mobile shop mode, hide the video player area */
    body.mobile-global-tabs.safari-entry-mode #player,
    body.mobile-global-tabs.safari-entry-mode .video-cover,
    body.mobile-global-tabs.safari-entry-mode .channel-info-display,
    body.mobile-global-tabs.safari-entry-mode .channel-avatar-container,
    body.mobile-global-tabs.safari-entry-mode .age-daily,
    body.mobile-global-tabs.safari-entry-mode .typo-controls,
    body.mobile-global-tabs.safari-entry-mode .collective-buttons {
        display: none !important;
    }
}

/* Safari direct channel link - hide channel info initially (before JS runs) */
/* This prevents the bio flash while pocket is loading */
html.safari-desktop.direct-channel-link .channel-info-display,
html.safari-desktop.direct-channel-link .channel-avatar-container,
html.safari-desktop.direct-channel-link .desktop-episode-title,
html.safari-desktop.direct-channel-link .mobile-now-playing {
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Safari channel mode - SHOW avatar and channel info (overrides the above) */
body.safari-channel-mode .channel-avatar-container,
body.safari-channel-mode .channel-info-display {
    opacity: 1 !important;
    visibility: visible !important;
    display: flex !important;
    pointer-events: auto !important;
}

/* Safari channel pocket mode - hide episode title only (keep avatar visible) */
body.safari-channel-pocket-mode .desktop-episode-title,
body.safari-channel-pocket-mode .mobile-now-playing {
    display: none !important;
}

/* Mobile: hide channel tabs when pocket is open (pocket has its own tabs) */
@media screen and (max-width: 768px) {
    body.safari-channel-pocket-mode .safari-channel-tabs,
    body.mobile-global-tabs.safari-channel-pocket-mode .safari-channel-tabs {
        display: none !important;
    }
}

/* Safari channel pocket mode - show inventory overlay */
body.safari-channel-pocket-mode .inventory-overlay {
    display: block !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}

body.safari-channel-pocket-mode .inventory-overlay.visible {
    opacity: 1 !important;
    pointer-events: auto !important;
}

/* Hide pocket and canvas links from channel info when tabs are shown */
/* Desktop: always hide (use tabs instead) */
/* Mobile: hide on all channels that have tabs (mobile-global-tabs class) */
html.safari-desktop .channel-info-pocket,
html.safari-desktop .channel-info-notes,
body.safari-channel-mode .channel-info-pocket,
body.safari-channel-mode .channel-info-notes,
body.mobile-global-tabs .channel-info-pocket,
body.mobile-global-tabs .channel-info-notes {
    display: none !important;
}

/* Hide old pocket tabs when using channel tabs */
body.safari-channel-mode .pocket-tabs,
body.safari-channel-pocket-mode .pocket-tabs,
body.mobile-global-tabs .pocket-tabs {
    display: none !important;
}

/* Show pocket close X on desktop tab modes */
body.safari-channel-mode .pocket-close-x,
body.safari-channel-pocket-mode .pocket-close-x {
    display: block !important;
    color: rgba(255, 255, 255, 0.7);
}

/* Hide pocket close X on mobile when using tabs (use tabs to switch instead) */
body.mobile-global-tabs .pocket-close-x {
    display: none !important;
}

/* In tabs mode, pocket viewing overlay needs higher z-index to appear above pocket grid */
body.safari-channel-mode .pocket-viewing-overlay.active,
body.safari-channel-pocket-mode .pocket-viewing-overlay.active {
    z-index: 250 !important;
}

/* In tabs mode, hide pocket grid when pocket viewing is active */
body.safari-channel-mode:has(.pocket-viewing-overlay.active) .inventory-overlay,
body.safari-channel-pocket-mode:has(.pocket-viewing-overlay.active) .inventory-overlay {
    display: none !important;
}

/* Hide shop content when in TV mode */
body.safari-tv-mode .safari-entry-static,
body.safari-tv-mode .safari-catalog,
body.safari-tv-mode .safari-featured-static {
    display: none !important;
}

/* Make shop overlay transparent and non-blocking in TV mode */
body.safari-tv-mode .shop-overlay {
    background: transparent !important;
    pointer-events: none !important;
}

body.safari-tv-mode .shop-overlay * {
    pointer-events: none !important;
}

/* Allow pointer events only on shop content when visible (not the whole overlay) */
body.safari-tv-mode .shop-overlay.visible .shop-featured,
body.safari-tv-mode .shop-overlay.visible .shop-featured-info,
body.safari-tv-mode .shop-overlay.visible .shop-backlist,
body.safari-tv-mode .shop-overlay.visible .shop-backlist-item,
body.safari-tv-mode .shop-overlay.visible .shop-preview-thumb,
body.safari-tv-mode .shop-overlay.visible .shop-main-image {
    pointer-events: auto !important;
}

body.safari-tv-mode .safari-entry-tabs,
body.safari-tv-mode .safari-entry-tabs * {
    pointer-events: auto !important;
}

/* Show TV UI when in TV mode */
body.safari-tv-mode .channel-info-display,
body.safari-tv-mode .channel-avatar-container,
body.safari-tv-mode #homeIndexButtons {
    display: flex !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}

/* age-daily needs block, not flex, to keep text inline */
body.safari-tv-mode .age-daily {
    display: block !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}

/* Ensure channel index overlay works in safari-tv-mode */
body.safari-tv-mode .channel-index-overlay.visible {
    opacity: 1 !important;
    pointer-events: auto !important;
    z-index: 600 !important;
}

/* Hide video cover in TV mode so video shows */
body.safari-tv-mode .video-cover,
body.safari-channel-mode .video-cover {
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Ensure safari-tv-link stays hidden */
.safari-tv-link {
    display: none !important;
}

/* ==================== SAFARI LANDING OVERLAY ==================== */
/* Three-column layout: Play button | Featured item | Pocket list */

.safari-landing-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #000;
    z-index: 800;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.safari-landing-overlay.visible {
    display: flex;
    opacity: 1;
}

.safari-landing-close {
    position: absolute;
    top: 20px;
    right: 24px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 32px;
    font-weight: 300;
    cursor: pointer;
    z-index: 810;
    padding: 8px;
    line-height: 1;
    transition: color 0.2s ease;
}

.safari-landing-close:hover {
    color: #fff;
}

.safari-landing-content {
    display: flex;
    width: 100%;
    height: 100%;
    padding: 60px 40px;
    box-sizing: border-box;
    gap: 40px;
}

/* Left column: Watch TV button */
.safari-landing-left {
    flex: 0 0 200px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.safari-landing-play {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    background: none;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 16px;
    padding: 32px 40px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.safari-landing-play:hover {
    border-color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.05);
}

.safari-landing-play-icon {
    font-size: 48px;
    color: #fff;
}

.safari-landing-play-text {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    text-transform: lowercase;
    letter-spacing: 0.5px;
}

/* Center column: Featured item + channel info */
.safari-landing-center {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    max-width: 500px;
}

.safari-landing-featured {
    width: 100%;
    aspect-ratio: 1;
    max-height: 60vh;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.safari-landing-featured img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.safari-landing-featured.video-featured {
    cursor: pointer;
    position: relative;
}

.safari-landing-featured.video-featured::after {
    content: '▶';
    position: absolute;
    font-size: 48px;
    color: rgba(255, 255, 255, 0.8);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.safari-landing-channel-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 20px;
}

.safari-landing-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.safari-landing-name {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.8);
}

/* Right column: Pocket items list */
.safari-landing-right {
    flex: 0 0 280px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.safari-landing-pocket-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
    padding-right: 8px;
}

.safari-landing-pocket-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.safari-landing-pocket-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.safari-landing-pocket-item.featured {
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.safari-landing-pocket-thumb {
    width: 48px;
    height: 48px;
    border-radius: 4px;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.1);
}

.safari-landing-pocket-name {
    flex: 1;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.safari-landing-pocket-type {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.4);
    text-transform: lowercase;
}

/* Empty state */
.safari-landing-empty {
    color: rgba(255, 255, 255, 0.4);
    font-size: 14px;
    text-align: center;
    padding: 40px;
}

/* Safari entry - static left sidebar */
.safari-entry-static {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 320px;
    height: 100vh;
    padding: 60px 40px;
    box-sizing: border-box;
    z-index: 300;
    flex-direction: column;
}

body.safari-entry-mode .safari-entry-static {
    display: flex;
}

/* Safari entry title - in static sidebar */
.safari-entry-title {
    display: none;
    color: white;
    font-size: 72px;
    font-family: 'Times New Roman', Times, serif;
    font-style: italic;
    margin-bottom: 10px;
}

/* Show Safari entry title only during Safari entry mode */
body.safari-entry-mode .safari-entry-title {
    display: flex;
}

/* Birth year - below Age Daily in static sidebar */
.safari-entry-birth {
    display: none;
    color: rgba(255, 255, 255, 0.5);
    font-family: Arial, sans-serif;
    font-size: 14px;
    margin-bottom: auto;
}

body.safari-entry-mode .safari-entry-birth {
    display: block;
}

/* Safari scrollable catalog - horizontal covers centered */
.safari-catalog {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    right: auto;
    bottom: auto;
    width: auto;
    height: auto;
    overflow: visible;
    padding: 0;
    z-index: 301;
}

body.safari-entry-mode .safari-catalog {
    display: block;
}

.safari-catalog-covers {
    display: flex;
    flex-direction: row;
    gap: 40px;
    align-items: center;
}

.safari-catalog-covers .safari-catalog-cover {
    width: auto;
    height: auto;
    max-height: 340px;
    background: black;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.5);
    overflow: visible;
    cursor: pointer;
    transition: transform 0.2s ease;
    position: relative;
}

.safari-catalog-covers .safari-catalog-cover:hover {
    transform: scale(1.03);
}

/* Catalog hover text */
.catalog-hover-text {
    opacity: 0;
    transition: opacity 0.25s ease;
    color: white;
    font-family: Arial, sans-serif;
    pointer-events: none;
    text-align: center;
    padding: 0 4px;
}

.safari-catalog-cover:hover .catalog-hover-text {
    opacity: 1;
}

.catalog-hover-above {
    position: absolute;
    top: -32px;
    left: 0;
    right: 0;
    font-size: 15px;
    font-weight: bold;
    white-space: nowrap;
}

.catalog-hover-above .catalog-hover-left {
    float: left;
}

.catalog-hover-above .catalog-hover-right {
    float: right;
}

.catalog-hover-below {
    position: absolute;
    top: 100%;
    margin-top: 8px;
    left: 0;
    right: 0;
    white-space: normal;
    font-size: 11px;
    line-height: 1.4;
    max-width: 280px;
}

.safari-catalog-covers .safari-catalog-cover img {
    width: auto;
    height: auto;
    max-height: 340px;
    display: block;
}

/* Legacy grid styles - no longer used but kept for reference */
.safari-catalog-grid {
    display: none;
}

.safari-catalog-entry {
    display: none;
}

/* Legacy cover cell (overridden by .safari-catalog-covers .safari-catalog-cover above) */
.safari-catalog-cover {
    width: 280px;
    aspect-ratio: 0.7;
    background: black;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    overflow: hidden;
}

.safari-catalog-cover img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Info cell */
.safari-catalog-info {
    padding: 10px 0;
}

.safari-catalog-author {
    font-family: 'Times New Roman', Times, serif;
    font-style: italic;
    font-size: 36px;
    color: white;
    line-height: 1;
    margin-bottom: 8px;
}

.safari-catalog-title {
    font-family: 'Times New Roman', Times, serif;
    font-style: italic;
    font-size: 18px;
    color: white;
    margin-bottom: 10px;
}

.safari-catalog-description {
    font-family: Georgia, serif;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.5;
    margin-top: 15px;
    margin-bottom: 0;
}

.safari-catalog-thumbs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.safari-catalog-thumb {
    width: 50px;
    height: 70px;
    background: rgba(255, 255, 255, 0.1);
    overflow: hidden;
    cursor: pointer;
    transition: opacity 0.2s;
}

.safari-catalog-thumb:hover {
    opacity: 0.8;
}

.safari-catalog-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Static featured image area - container for product detail */
.safari-featured-static {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 302;
    pointer-events: none;
}

body.safari-entry-mode .safari-featured-static {
    display: block;
}

body.safari-product-detail-open .safari-featured-static {
    pointer-events: auto;
}

.safari-featured-static img {
    width: 100%;
    height: auto;
    max-height: 100%;
    object-fit: contain;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

/* Safari product detail view - scrollable images with info overlay */
.safari-product-detail {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: black;
    display: flex;
    justify-content: center;
    overflow-y: auto;
    padding: 40px 20px;
    z-index: 400;
}

.safari-product-close {
    position: fixed;
    top: 20px;
    right: 20px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 32px;
    cursor: pointer;
    z-index: 410;
    line-height: 1;
}

.safari-product-close:hover {
    color: white;
}

/* Scrollable image stack - center of page */
.safari-product-images {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding-bottom: 60px;
}

.safari-product-images img {
    max-width: 70vw;
    height: auto;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
}

/* Portrait images - fill viewport height */
.safari-product-images img.portrait-img {
    height: calc(100vh - 80px);
    width: auto;
    max-width: none;
}

/* Landscape images - keep current sizing */
.safari-product-images img.landscape-img {
    max-width: 70vw;
    height: auto;
}

/* Info section - fixed left side between Age Daily and maintained by */
.safari-product-info {
    position: fixed;
    left: 40px;
    top: 100px;
    bottom: 100px;
    width: 200px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 410;
}

.safari-product-title {
    font-family: Georgia, serif;
    font-size: 22px;
    color: white;
    line-height: 1.2;
}

.safari-product-author {
    font-family: 'Times New Roman', Times, serif;
    font-style: italic;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 10px;
}

.safari-product-description {
    font-family: Georgia, serif;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.6;
}

.safari-product-info .author-link {
    color: inherit;
    text-decoration: none;
}

.safari-product-info .author-link:hover {
    font-weight: bold;
    text-decoration: underline;
}

/* Pull quotes - fixed right side */
.safari-product-quotes {
    position: fixed;
    right: 40px;
    top: 100px;
    bottom: 100px;
    width: 220px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    font-family: Georgia, serif;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.7;
    font-style: italic;
    z-index: 410;
}

@media screen and (max-width: 1024px) {
    .safari-product-quotes {
        display: none;
    }
}

/* Price and cart - fixed bottom right */
.safari-product-purchase {
    position: fixed;
    bottom: 40px;
    right: 40px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
    z-index: 410;
}

.safari-product-price {
    font-family: Georgia, serif;
    font-size: 18px;
    color: white;
}

.safari-product-cart-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.5);
    color: white;
    font-family: 'Times New Roman', Times, serif;
    font-style: italic;
    font-size: 14px;
    padding: 10px 20px;
    cursor: pointer;
}

.safari-product-cart-btn:hover {
    border-color: white;
}

/* Product specs - fixed bottom left */
.safari-product-specs {
    position: fixed;
    bottom: 40px;
    left: 40px;
    font-family: Arial, sans-serif;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.6;
    z-index: 410;
}

.safari-spec-line {
    margin-bottom: 2px;
}

/* Hide specs on mobile */
@media (max-width: 768px) {
    .safari-product-specs {
        display: none !important;
    }
}

.safari-product-cart-btn.disabled,
.safari-add-cart-btn.disabled {
    opacity: 0.5;
    cursor: default;
    border-style: dashed;
}

.safari-product-cart-btn.disabled:hover,
.safari-add-cart-btn.disabled:hover {
    border-color: rgba(255, 255, 255, 0.5);
}

.safari-product-coming-soon {
    font-family: 'Times New Roman', Times, serif;
    font-style: italic;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
}

/* Hide catalog covers when product detail is open */
body.safari-product-detail-open .safari-catalog {
    display: none;
}

/* Featured stack - scrollable column of previews */
.safari-featured-stack {
    display: flex;
    flex-direction: column;
    gap: 15px;
    overflow-y: auto;
    max-height: 100%;
}

.safari-featured-item {
    cursor: pointer;
    transition: opacity 0.2s;
}

.safari-featured-item:hover {
    opacity: 0.85;
}

.safari-featured-item img {
    width: 100%;
    height: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

/* Enlarged image overlay - scrollable stack */
.safari-enlarged-overlay {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 340px;
    right: 0;
    background: black;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.safari-enlarged-overlay.scrollable {
    padding: 0;
}

.safari-enlarged-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 0;
    display: flex;
    flex-direction: column;
}

.safari-enlarged-item {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    min-height: 100vh;
    padding: 40px;
    box-sizing: border-box;
}

.safari-enlarged-item img {
    max-width: 100%;
    max-height: calc(100vh - 80px);
    object-fit: contain;
}

.safari-enlarged-close {
    position: fixed;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 32px;
    font-weight: 200;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    width: 40px;
    height: 40px;
    z-index: 10001;
}

.safari-enlarged-close:hover {
    color: white;
}

/* Add to cart button in catalog */
.safari-add-cart-btn {
    margin-top: 15px;
    padding: 10px 20px;
    background: white;
    color: black;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.2s;
}

.safari-add-cart-btn:hover {
    opacity: 0.85;
}

/* TV button in catalog (below Compact's add to cart) */
.safari-tv-btn {
    display: block;
    margin-top: 30px;
    margin-left: 40px;
    padding: 8px 16px;
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.safari-tv-btn:hover {
    color: white;
    border-color: rgba(255, 255, 255, 0.6);
}

/* Hide old shop elements in Safari entry mode */
body.safari-entry-mode .shop-featured,
body.safari-entry-mode .shop-featured-info,
body.safari-entry-mode .shop-backlist,
body.safari-entry-mode .shop-product-specs,
body.safari-entry-mode .shop-stage-quote {
    display: none !important;
}

/* Position contact info in left static column during Safari entry */
body.safari-entry-mode .contact-email {
    display: block !important;
    position: fixed !important;
    left: 40px !important;
    right: auto !important;
    bottom: 40px !important;
    top: auto !important;
    transform: none !important;
}

@media screen and (min-width: 769px) {
    body.safari-entry-mode .maintained-by {
        display: block !important;
        position: fixed !important;
        left: 40px !important;
        right: auto !important;
        bottom: 60px !important;
        top: auto !important;
        transform: none !important;
    }
}

/* Toggle positioned midway between Age Daily and maintained-by */
body.safari-entry-mode .shop-tv-toggle {
    bottom: 120px !important;
}

/* In TV mode, position toggle near bottom left */
body.global-channel-active:not(.safari-entry-mode) .shop-tv-toggle {
    bottom: 40px;
}

/* Cart positioned below contact email in Safari entry mode */
body.safari-entry-mode #shopCart {
    position: fixed !important;
    left: 40px !important;
    right: auto !important;
    top: calc(50% + 30px) !important;
    bottom: auto !important;
    width: 240px !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

/* Safari TV link - in static sidebar at bottom */
.safari-tv-link {
    display: none;
    position: fixed;
    bottom: 60px;
    left: 40px;
    color: white;
    cursor: pointer;
    z-index: 9999;
    pointer-events: auto !important;
    text-decoration: none;
    opacity: 0.8;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}

.safari-tv-link:hover {
    opacity: 1;
}

/* "& see:" text */
.safari-tv-ampersand {
    font-family: Arial, sans-serif;
    font-size: 14px;
}

/* Row with circle and network text */
.safari-tv-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* TV circle - larger with A.D / T.V text */
.tv-circle {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 60px;
    height: 60px;
    border: 2px solid white;
    border-radius: 50%;
    font-family: Arial, sans-serif;
    font-weight: bold;
    line-height: 1.1;
}

.tv-circle-ad {
    font-size: 14px;
    letter-spacing: 1px;
}

.tv-circle-tv {
    font-size: 14px;
    letter-spacing: 1px;
}

/* Left antenna (rabbit ear) */
.tv-circle::before {
    content: '';
    position: absolute;
    width: 2px;
    height: 16px;
    background: white;
    top: -14px;
    left: 14px;
    transform: rotate(-30deg);
    transform-origin: bottom center;
}

/* Right antenna (rabbit ear) */
.tv-circle::after {
    content: '';
    position: absolute;
    width: 2px;
    height: 16px;
    background: white;
    top: -14px;
    right: 14px;
    transform: rotate(30deg);
    transform-origin: bottom center;
}

/* "Collective Curatorial Network" text - to the right of circle, italic Times */
.safari-tv-network {
    font-family: "Times New Roman", Times, serif;
    font-style: italic;
    font-size: 13px;
    white-space: nowrap;
    margin-left: 4px;
}

/* Show TV link during Safari entry */
/* Safari TV link - now replaced by tabs, keep hidden */
body.safari-entry-mode .safari-tv-link {
    display: none !important;
}

/* Fix shop-featured-info position for Safari entry - more space from image */
.shop-overlay.safari-entry .shop-featured-info {
    right: 1080px;
}

/* Featured book section - positioned left of Age Daily title */
.shop-featured {
    position: absolute;
    top: 60px;
    right: 560px;
    bottom: 120px;
    display: flex;
    align-items: flex-start;
    gap: 15px;
    pointer-events: auto;
}

.shop-author-name {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    text-align: right;
    align-self: flex-start;
    margin-right: 15px;
}

.shop-author-name span {
    font-family: 'Times New Roman', Times, serif;
    font-style: italic;
    font-size: 120px;
    color: white;
    line-height: 0.9;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.shop-featured-cover {
    position: relative;
    top: auto;
    right: auto;
    width: auto;
    height: 85%;
    aspect-ratio: 0.7;
    background: white;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    overflow: hidden;
    flex-shrink: 0;
    align-self: flex-start;
    z-index: auto;
}

.shop-featured-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Small size variant for smaller books */
.shop-featured-cover.small {
    height: 65%;
    aspect-ratio: 0.71; /* 105x148mm ratio */
}

.shop-featured-cover.small img {
    object-fit: contain;
}

/* Spread mode - horizontal images cover the right side */
.shop-featured-cover.spread {
    position: fixed;
    top: 60px;
    right: 20px;
    width: auto;
    height: 85%;
    aspect-ratio: auto;
    z-index: 190;
}

.shop-featured-cover.spread img {
    width: auto;
    height: 100%;
    object-fit: contain;
}

/* Hide Age Daily title and author name when spread is showing */
body.shop-spread-mode .global-channel-title {
    display: none !important;
}

body.shop-spread-mode .shop-author-name {
    display: none !important;
}

.shop-featured-info {
    position: absolute;
    right: 1200px;
    max-width: 220px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: auto;
}

.shop-featured-title {
    font-family: 'Times New Roman', Times, serif;
    font-style: italic;
    font-size: 20px;
    color: white;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.shop-featured-description {
    font-family: Georgia, serif;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.5;
    text-shadow: 0 1px 5px rgba(0, 0, 0, 0.5);
}

/* Product specs - lower left on desktop */
.shop-product-specs {
    position: fixed;
    bottom: 100px;
    left: 20px;
    font-family: Arial, sans-serif;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.6;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    z-index: 100;
}

.shop-product-specs .spec-line {
    margin-bottom: 2px;
}

/* Hide specs on mobile */
@media (max-width: 768px) {
    .shop-product-specs {
        display: none !important;
    }
}

/* Preview thumbnails */
.shop-preview-thumbs {
    display: flex;
    gap: 6px;
    margin-top: 10px;
}

.shop-preview-thumb {
    width: 45px;
    height: 64px;
    background: white;
    cursor: pointer;
    overflow: hidden;
    opacity: 0.5;
    transition: opacity 0.2s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.shop-preview-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.shop-preview-thumb:hover {
    opacity: 0.9;
}

.shop-preview-thumb.active {
    opacity: 1;
    box-shadow: 0 0 0 2px white, 0 3px 10px rgba(0, 0, 0, 0.4);
}

.shop-buy-link {
    font-family: 'Times New Roman', Times, serif;
    font-style: italic;
    font-size: 16px;
    color: white;
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.5);
    padding-bottom: 2px;
    margin-top: 15px;
    align-self: flex-start;
    text-shadow: 0 1px 5px rgba(0, 0, 0, 0.5);
}

.shop-buy-link:hover {
    border-color: white;
}

.shop-buy-link.disabled {
    pointer-events: none;
    cursor: default;
    opacity: 0.7;
    border-bottom-style: dashed;
}

/* Shop tagline - in bottom black bar, aligned with Add to Cart */
.shop-tagline {
    position: absolute;
    bottom: 40px;
    left: calc(100% - 1020px - 220px);
    font-family: Arial, sans-serif;
    font-style: italic;
    font-size: 12px;
    color: white;
    pointer-events: none;
}

/* Shop established - in bottom black bar, aligned with right edge of featured image */
.shop-established {
    position: absolute;
    bottom: 40px;
    right: 560px;
    font-family: Arial, sans-serif;
    font-size: 12px;
    color: white;
    pointer-events: none;
}

/* Shop A.D. label - in bottom black bar, just right of featured image */
.shop-ad-label {
    position: absolute;
    bottom: 40px;
    left: calc(100% - 555px);
    font-family: Arial, sans-serif;
    font-size: 12px;
    color: white;
    pointer-events: none;
}

/* Hide tagline, established, A.D. label, notice, maintained-by, and contact-email on mobile */
@media screen and (max-width: 768px) {
    .shop-tagline,
    .shop-established,
    .shop-ad-label,
    .shop-notice,
    .maintained-by,
    .contact-email {
        display: none !important;
    }
}

/* Backlist items - positioned below Age Daily title */
.shop-stage-quote {
    position: absolute;
    right: 60px;
    top: 35%;
    max-width: 300px;
    font-family: Georgia, serif;
    font-size: 13px;
    font-style: italic;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.6;
    text-align: right;
    display: none;
}

.shop-backlist {
    position: absolute;
    top: 50%;
    right: 60px;
    display: flex;
    flex-wrap: wrap;
    gap: 20px 30px;
    max-width: 460px;
    pointer-events: auto;
}

.shop-backlist-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.shop-backlist-cover {
    width: 70px;
    height: 100px;
    background: white;
    background-size: cover;
    background-position: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
}

.shop-backlist-info {
    max-width: 120px;
}

.shop-backlist-title {
    font-family: 'Times New Roman', Times, serif;
    font-style: italic;
    font-size: 14px;
    color: white;
    text-shadow: 0 1px 5px rgba(0, 0, 0, 0.5);
    margin-bottom: 4px;
}

.shop-backlist-author {
    font-family: Georgia, serif;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    text-shadow: 0 1px 5px rgba(0, 0, 0, 0.5);
}

.shop-backlist-author .author-link {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
}

.shop-backlist-author .author-link:hover {
    text-decoration: underline;
}

.shop-notice {
    position: absolute;
    bottom: 40px;
    right: 280px;
    font-family: Arial, sans-serif;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
    pointer-events: none;
}

/* Desktop login button (home channel only when not logged in) */
.desktop-login {
    display: none;
    position: fixed;
    bottom: 25px;
    left: 129px;
    z-index: 200;
}

/* Show by default on desktop when on home/global channel */
@media screen and (min-width: 1025px) {
    html.global-channel-active .desktop-login {
        display: block;
    }
}

/* Mobile shop overlay */
@media screen and (max-width: 1024px) {


    .shop-featured {
        top: auto;
        bottom: 200px;
        right: 20px;
        left: 20px;
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }

    .shop-author-name {
        align-items: center;
        text-align: center;
    }

    .shop-author-name span {
        font-size: 40px;
    }

    .shop-featured-cover {
        width: 180px;
        height: 260px;
    }

    .shop-featured-info {
        text-align: center;
        align-items: center;
    }

    .shop-preview-thumbs {
        justify-content: center;
    }

    .shop-buy-link {
        align-self: center;
    }

    .shop-backlist {
        top: auto;
        bottom: 80px;
        right: 20px;
        left: 20px;
        justify-content: center;
    }

    .shop-backlist-cover {
        width: 50px;
        height: 72px;
    }

    .shop-backlist-info {
        max-width: 80px;
    }

    .shop-backlist-title {
        font-size: 12px;
    }

    .shop-backlist-author {
        font-size: 10px;
    }
}

/* Hide shop on mobile EXCEPT for mobile global */
@media screen and (max-width: 768px) {
    .shop-overlay,
    .shop-cart {
        display: none !important;
    }

    /* Show shop overlay on mobile global in shop mode */
    body.mobile-global-tabs.safari-entry-mode .shop-overlay {
        display: block !important;
        background: black;
    }

    /* Mobile shop overlay layout */
    body.mobile-global-tabs.safari-entry-mode .shop-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 10000;
    }

    /* Hide desktop-only shop elements on mobile */
    body.mobile-global-tabs .safari-entry-tabs,
    body.mobile-global-tabs .safari-entry-static,
    body.mobile-global-tabs .safari-catalog,
    body.mobile-global-tabs .safari-featured-static,
    body.mobile-global-tabs .shop-featured,
    body.mobile-global-tabs .shop-featured-info {
        display: none !important;
    }

    /* Mobile shop title - "Age Daily" at top right */
    body.mobile-global-tabs.safari-entry-mode .shop-overlay .mobile-shop-title {
        display: block;
        position: absolute;
        top: 50px;
        right: 20px;
        left: auto;
        text-align: right;
        font-family: 'Times New Roman', Times, serif;
        font-size: 40px;
        font-style: italic;
        color: white;
        z-index: 10;
    }

    /* Mobile shop footer row - contains footer text and cart icon */
    body.mobile-global-tabs.safari-entry-mode .shop-overlay .mobile-shop-footer-row {
        display: flex;
        align-items: flex-end;
        justify-content: space-between;
        position: absolute;
        bottom: 30px;
        left: 20px;
        right: 20px;
        z-index: 10;
    }

    /* Mobile shop footer - two lines, lower left */
    body.mobile-global-tabs.safari-entry-mode .shop-overlay .mobile-shop-footer {
        display: none;
    }

    body.mobile-global-tabs.safari-entry-mode .shop-overlay .mobile-shop-footer a {
        color: white;
        font-weight: bold;
        text-decoration: none;
    }

    /* Mobile shop cart icon - appears when items in cart */
    body.mobile-global-tabs.safari-entry-mode .shop-overlay .mobile-shop-cart-icon {
        display: none;
        flex-direction: column;
        align-items: flex-end;
        gap: 2px;
        cursor: pointer;
        padding: 8px 12px;
        background: rgba(255, 255, 255, 0.1);
        border-radius: 8px;
        font-family: Arial, sans-serif;
    }

    body.mobile-global-tabs.safari-entry-mode .shop-overlay .mobile-shop-cart-icon.visible {
        display: flex;
    }

    body.mobile-global-tabs.safari-entry-mode .shop-overlay .mobile-shop-cart-count {
        font-size: 11px;
        color: rgba(255, 255, 255, 0.7);
    }

    body.mobile-global-tabs.safari-entry-mode .shop-overlay .mobile-shop-cart-total {
        font-size: 14px;
        font-weight: bold;
        color: white;
    }

    /* Non-Safari mobile browsers - footer row */
    body.mobile-global-tabs:not(.safari-entry-mode) .shop-overlay .mobile-shop-footer-row {
        display: flex;
        align-items: flex-end;
        justify-content: space-between;
        position: fixed;
        bottom: 30px;
        left: 20px;
        right: 20px;
        z-index: 10;
    }

    body.mobile-global-tabs:not(.safari-entry-mode) .shop-overlay .mobile-shop-footer {
        display: none;
    }

    body.mobile-global-tabs:not(.safari-entry-mode) .shop-overlay .mobile-shop-footer a {
        color: white;
        font-weight: bold;
        text-decoration: none;
    }

    body.mobile-global-tabs:not(.safari-entry-mode) .shop-overlay .mobile-shop-cart-icon {
        display: none;
        flex-direction: column;
        align-items: flex-end;
        gap: 2px;
        cursor: pointer;
        padding: 8px 12px;
        background: rgba(255, 255, 255, 0.1);
        border-radius: 8px;
        font-family: Arial, sans-serif;
    }

    body.mobile-global-tabs:not(.safari-entry-mode) .shop-overlay .mobile-shop-cart-icon.visible {
        display: flex;
    }

    body.mobile-global-tabs:not(.safari-entry-mode) .shop-overlay .mobile-shop-cart-count {
        font-size: 11px;
        color: rgba(255, 255, 255, 0.7);
    }

    body.mobile-global-tabs:not(.safari-entry-mode) .shop-overlay .mobile-shop-cart-total {
        font-size: 14px;
        font-weight: bold;
        color: white;
    }

    body.mobile-global-tabs:not(.safari-entry-mode) .mobile-shop-birth {
        display: block;
        position: fixed;
        bottom: 30px;
        right: 20px;
        left: auto;
        text-align: right;
        font-family: Arial, sans-serif;
        font-size: 11px;
        color: rgba(255, 255, 255, 0.5);
        z-index: 10;
    }

    /* Mobile shop birth - "b.2026" */
    /* Portrait: lower right corner */
    body.mobile-global-tabs.safari-entry-mode .mobile-shop-birth {
        display: block;
        position: fixed;
        bottom: 30px;
        right: 20px;
        left: auto;
        text-align: right;
        font-family: Arial, sans-serif;
        font-size: 11px;
        color: rgba(255, 255, 255, 0.5);
        z-index: 10;
    }

    /* Hide birth when not in shop mode */
    .mobile-shop-birth {
        display: none;
    }

    /* Mobile shop backlist - horizontal row centered vertically */
    body.mobile-global-tabs.safari-entry-mode .shop-backlist {
        display: flex !important;
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        bottom: auto;
        right: auto;
        flex-direction: row;
        gap: 25px;
        justify-content: center;
        align-items: flex-start;
    }

    body.mobile-global-tabs.safari-entry-mode .shop-backlist-item {
        flex-direction: column;
        align-items: center;
        text-align: center;
        cursor: pointer;
    }

    body.mobile-global-tabs.safari-entry-mode .shop-backlist-cover {
        width: 70px;
        height: 100px;
        margin-bottom: 0;
    }

    /* Hide titles below thumbnails on mobile - just show covers */
    body.mobile-global-tabs.safari-entry-mode .shop-backlist-info {
        display: none;
    }

    /* Hide backlist and header when viewing product detail */
    body.mobile-global-tabs.mobile-shop-detail .shop-backlist,
    body.mobile-global-tabs.mobile-shop-detail .mobile-shop-title {
        display: none !important;
    }

    /* Hide cart when gallery is open */
    body.mobile-shop-gallery-open .shop-cart {
        display: none !important;
    }

    /* ===== Mobile Product Detail View ===== */
    .mobile-shop-detail-view {
        display: none;
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 100;
    }

    body.mobile-shop-detail .mobile-shop-detail-view {
        display: block;
    }

    .mobile-shop-back {
        position: absolute;
        top: 15px;
        right: 15px;
        width: 30px;
        height: 30px;
        background: transparent;
        border: none;
        color: white;
        font-size: 28px;
        cursor: pointer;
        z-index: 200;
        font-family: Arial, sans-serif;
        line-height: 1;
    }

    .mobile-shop-detail-content {
        position: absolute;
        top: 60px;
        left: 20px;
        right: 20px;
        bottom: 80px;
        display: flex;
        flex-direction: column;
    }

    /* Title and author at top */
    .mobile-shop-product-header {
        margin-bottom: 15px;
    }

    .mobile-shop-product-title {
        font-family: 'Times New Roman', Times, serif;
        font-style: italic;
        font-size: 28px;
        color: white;
        margin-bottom: 5px;
    }

    .mobile-shop-product-author {
        font-family: Arial, sans-serif;
        font-size: 12px;
        color: rgba(255, 255, 255, 0.7);
    }

    /* Cover and info row below title */
    .mobile-shop-product-row {
        display: flex;
        gap: 15px;
        margin-bottom: 15px;
    }

    .mobile-shop-product-cover {
        width: 120px;
        height: 170px;
        flex-shrink: 0;
        cursor: pointer;
    }

    .mobile-shop-product-cover img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    /* Portrait: only show first image in cover (rest are in thumbs) */
    .mobile-shop-product-cover img:not(:first-child) {
        display: none;
    }

    .mobile-shop-product-info {
        flex: 1;
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .mobile-shop-product-description {
        font-family: Arial, sans-serif;
        font-size: 12px;
        line-height: 1.5;
        color: rgba(255, 255, 255, 0.8);
        flex: 1;
        overflow-y: auto;
    }

    .mobile-shop-product-price {
        font-family: Arial, sans-serif;
        font-size: 14px;
        color: rgba(255, 255, 255, 0.9);
        margin-top: 5px;
    }

    .mobile-shop-buy-link {
        display: inline-block;
        font-family: Arial, sans-serif;
        font-size: 13px;
        color: white;
        text-decoration: underline;
        cursor: pointer;
        margin-top: 8px;
        background: none;
        border: none;
        padding: 0;
    }

    .mobile-shop-buy-link.disabled {
        color: rgba(255, 255, 255, 0.4);
        cursor: default;
    }

    /* Landscape-only buy section - hidden in portrait */
    .mobile-shop-landscape-buy {
        display: none;
    }

    /* Mobile preview thumbnails */
    .mobile-shop-preview-thumbs {
        display: flex;
        gap: 10px;
        flex-wrap: wrap;
    }

    .mobile-shop-preview-thumb {
        width: 50px;
        height: 70px;
        cursor: pointer;
        opacity: 0.7;
        transition: opacity 0.2s;
    }

    .mobile-shop-preview-thumb:hover,
    .mobile-shop-preview-thumb.active {
        opacity: 1;
    }

    .mobile-shop-preview-thumb img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    /* ===== Mobile Image Gallery - Vertical Scroll ===== */
    .mobile-shop-gallery {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: black;
        z-index: 10100;
    }

    body.mobile-shop-gallery-open .mobile-shop-gallery {
        display: block;
    }

    .mobile-shop-gallery-back {
        position: fixed;
        top: 15px;
        right: 15px;
        width: 30px;
        height: 30px;
        background: transparent;
        border: none;
        color: white;
        font-size: 28px;
        cursor: pointer;
        z-index: 10101;
        font-family: Arial, sans-serif;
        line-height: 1;
    }

    .mobile-shop-gallery-container {
        width: 100%;
        height: 100%;
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: y mandatory;
    }

    .mobile-shop-gallery-item {
        width: 100%;
        height: 100vh;
        display: flex;
        align-items: center;
        justify-content: center;
        scroll-snap-align: start;
    }

    .mobile-shop-gallery-item img {
        max-width: 100%;
        max-height: 100%;
        object-fit: contain;
    }

    /* Hide dots - using scroll instead */
    .mobile-shop-gallery-dots {
        display: none;
    }

    /* ===== Mobile Cart ===== */
    body.mobile-global-tabs.safari-entry-mode .shop-cart {
        display: none;
        position: fixed;
        top: auto;
        bottom: 20px;
        left: auto;
        right: 20px;
        transform: none;
        z-index: 10050;
        min-width: 180px;
        max-width: 220px;
    }

    body.mobile-global-tabs.safari-entry-mode .shop-cart.has-items {
        display: block !important;
    }
}

/* ===== Mobile Shop Landscape Layout ===== */
@media screen and (max-width: 896px) and (orientation: landscape) {
    /* Full black background for detail view - cover entire viewport */
    body.mobile-shop-detail .mobile-shop-detail-view {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        height: 100vh !important;
        background: black;
    }

    /* Landscape: full-screen scrollable images with side elements */
    body.mobile-shop-detail .mobile-shop-detail-content {
        display: block;
        position: absolute;
        top: 0;
        bottom: 0;
        left: 0;
        right: 0;
        background: black;
    }

    /* Hide the row container, position children absolutely */
    body.mobile-shop-detail .mobile-shop-product-row {
        display: contents;
    }

    /* Title/author - top right, below X-to-close */
    body.mobile-shop-detail .mobile-shop-product-header {
        position: fixed;
        top: 50px;
        right: 15px;
        width: auto;
        max-width: 30%;
        text-align: right;
        margin: 0;
        z-index: 10;
    }

    body.mobile-shop-detail .mobile-shop-product-title {
        font-size: 14px;
        margin-bottom: 2px;
    }

    body.mobile-shop-detail .mobile-shop-product-author {
        font-size: 10px;
    }

    /* Description - left side, below tabs */
    body.mobile-shop-detail .mobile-shop-product-info {
        position: fixed !important;
        top: 50px;
        left: 15px;
        width: 20%;
        max-width: 140px;
        display: block !important;
        z-index: 10;
    }

    body.mobile-shop-detail .mobile-shop-product-description {
        font-size: 10px;
        line-height: 1.4;
        color: rgba(255, 255, 255, 0.9);
    }

    /* Hide price and buy link from info section - they go in landscape-buy */
    body.mobile-shop-detail .mobile-shop-product-info .mobile-shop-product-price,
    body.mobile-shop-detail .mobile-shop-product-info .mobile-shop-buy-link {
        display: none;
    }

    /* Scrollable enhanced images - centered, full viewport height */
    body.mobile-shop-detail .mobile-shop-product-cover {
        position: fixed !important;
        top: 0 !important;
        bottom: 0 !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        width: 50% !important;
        max-width: 400px !important;
        height: 100vh !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: flex-start !important;
        gap: 10px !important;
        padding: 10px 0 !important;
        flex-shrink: unset !important;
    }

    body.mobile-shop-detail .mobile-shop-product-cover img {
        display: block !important;
        width: auto !important;
        max-width: 100% !important;
        height: auto !important;
        max-height: none !important;
        object-fit: contain !important;
        flex-shrink: 0 !important;
        cursor: default !important;
        pointer-events: none !important;
    }

    /* Hide separate thumbs container - images are in scrollable area */
    body.mobile-shop-detail .mobile-shop-preview-thumbs {
        display: none !important;
    }

    /* Add to Cart button - bottom right */
    body.mobile-shop-detail .mobile-shop-landscape-buy {
        display: flex !important;
        flex-direction: column;
        position: fixed;
        bottom: 10px;
        right: 15px;
        align-items: flex-end;
        gap: 4px;
        z-index: 20;
    }

    body.mobile-shop-detail .mobile-shop-landscape-price {
        font-family: Arial, sans-serif;
        font-size: 12px;
        font-weight: bold;
        color: white;
    }

    body.mobile-shop-detail .mobile-shop-landscape-btn {
        font-family: Arial, sans-serif;
        font-size: 11px;
        color: white;
        text-decoration: underline;
        cursor: pointer;
        background: none;
        border: none;
        padding: 3px 0;
    }

    body.mobile-shop-detail .mobile-shop-landscape-btn.disabled {
        color: rgba(255, 255, 255, 0.4);
        cursor: default;
    }

    /* Cart positioning - right side, below title/author, above add to cart */
    body.mobile-shop-detail .shop-cart {
        position: fixed !important;
        top: 55px !important;
        bottom: 50px !important;
        left: auto !important;
        right: 15px !important;
        transform: none !important;
        width: 120px !important;
        max-width: 120px !important;
        min-width: auto !important;
        text-align: right;
        z-index: 15;
        overflow-y: auto;
    }

    /* Hide cart when gallery is open in landscape */
    body.mobile-shop-gallery-open .shop-cart {
        display: none !important;
    }

    /* Landscape: b.2026 aligned with Age Daily horizontally, footer vertically */
    body.mobile-global-tabs.safari-entry-mode .mobile-shop-birth {
        display: block;
        position: fixed;
        bottom: 30px;
        right: 20px;
        left: auto;
        text-align: right;
        font-family: Arial, sans-serif;
        font-size: 11px;
        color: rgba(255, 255, 255, 0.5);
        z-index: 10;
    }
}

/* ===== Hide UI elements in landscape TV mode ===== */
@media screen and (max-width: 896px) and (orientation: landscape) {
    /* Hide shop/tv tabs when in TV mode (not shop) */
    body.safari-tv-mode .safari-entry-tabs,
    body:not(.safari-entry-mode) .safari-entry-tabs {
        display: none !important;
    }

    /* Hide channel tabs in landscape */
    body.safari-tv-mode .safari-channel-tabs,
    body:not(.safari-entry-mode) .safari-channel-tabs {
        display: none !important;
    }

    /* Hide tv/pocket tabs in landscape on mobile for individual channels */
    body.mobile-global-tabs:not(.global-channel-active) .safari-channel-tabs {
        display: none !important;
    }

    /* Hide ALL tabs in mobile landscape - just show video */
    .safari-channel-tabs,
    .safari-entry-tabs {
        display: none !important;
    }

    /* Hide shop and login buttons in landscape TV mode */
    body.safari-tv-mode #typoShopBtn,
    body.safari-tv-mode #typoLoginBtn,
    body:not(.safari-entry-mode) #typoShopBtn,
    body:not(.safari-entry-mode) #typoLoginBtn {
        display: none !important;
    }
}

/* Hide mobile shop elements on desktop */
.shop-mobile-grid,
.shop-mobile-expanded,
.shop-mobile-cart-icon,
.shop-mobile-cart-overlay,
.mobile-shop-title,
.mobile-shop-footer,
.mobile-shop-footer-row,
.mobile-shop-cart-icon,
.mobile-shop-detail-view,
.mobile-shop-gallery {
    display: none;
}

/* Shopping Cart */
.shop-cart {
    position: fixed;
    top: 50%;
    left: 20px;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 12px;
    min-width: 200px;
    max-width: 280px;
    z-index: 1001;
    display: none;
    font-family: Arial, sans-serif;
}

/* Cart visibility is now controlled by JS based on items in cart */

.shop-cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 14px;
    font-weight: bold;
}

.shop-cart-count {
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
}

.shop-cart-items {
    max-height: 200px;
    overflow-y: auto;
}

.shop-cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 13px;
}

.shop-cart-item:last-child {
    border-bottom: none;
}

.shop-cart-item-name {
    flex: 1;
    margin-right: 10px;
}

.shop-cart-item-remove {
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    font-size: 16px;
    padding: 0 5px;
}

.shop-cart-item-remove:hover {
    color: white;
}

.shop-cart-footer {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.shop-checkout-btn {
    width: 100%;
    padding: 10px;
    background: white;
    color: black;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.shop-checkout-btn:hover {
    opacity: 0.9;
}

.shop-cart-empty {
    color: rgba(255, 255, 255, 0.5);
    font-size: 13px;
    text-align: center;
    padding: 10px 0;
}

/* PayPal Checkout Modal */
.paypal-checkout-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.paypal-checkout-content {
    background: #1a1a1a;
    border-radius: 12px;
    max-width: 400px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.paypal-checkout-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 16px;
    color: white;
}

.paypal-checkout-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.paypal-checkout-close:hover {
    color: white;
}

.paypal-checkout-summary {
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.paypal-checkout-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
}

.paypal-checkout-item-name {
    flex: 1;
}

.paypal-checkout-item-price {
    color: white;
    font-weight: bold;
}

.paypal-checkout-total {
    display: flex;
    justify-content: space-between;
    padding-top: 12px;
    margin-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    font-weight: bold;
    font-size: 16px;
}

.paypal-checkout-email {
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.paypal-checkout-email label {
    display: block;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 8px;
}

.paypal-checkout-email input {
    width: 100%;
    padding: 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: white;
    font-size: 14px;
    box-sizing: border-box;
}

.paypal-checkout-email input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.4);
}

/* Shipping Fields */
.paypal-checkout-shipping {
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.paypal-shipping-field {
    margin-bottom: 10px;
}

.paypal-shipping-field label {
    display: block;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 6px;
}

.paypal-shipping-field input,
.paypal-shipping-field select {
    width: 100%;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: white;
    font-size: 14px;
    box-sizing: border-box;
}

.paypal-shipping-field input:focus,
.paypal-shipping-field select:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.4);
}

.paypal-shipping-field select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='white' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.paypal-shipping-field select option {
    background: #1a1a1a;
    color: white;
}

.paypal-shipping-row {
    display: flex;
    gap: 10px;
}

.paypal-shipping-field-half {
    flex: 1;
}

.paypal-shipping-field-quarter {
    flex: 0 0 80px;
}

/* Calculate Shipping Button */
.paypal-calculate-shipping-btn {
    width: 100%;
    padding: 14px;
    margin-top: 16px;
    margin-bottom: 8px;
    background: #4a90d9;
    border: none;
    border-radius: 6px;
    color: white;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
}

.paypal-calculate-shipping-btn:hover {
    background: #5a9fe9;
}

.paypal-calculate-shipping-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.paypal-calculate-shipping-btn.loading {
    opacity: 0.7;
    cursor: wait;
}

/* Shipping Rates Section */
.paypal-shipping-rates {
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.paypal-shipping-rates > label {
    display: block;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 10px;
}

.paypal-shipping-rates-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.shipping-rate-option {
    display: flex;
    align-items: center;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.shipping-rate-option:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}

.shipping-rate-option.selected {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.5);
}

.shipping-rate-option input[type="radio"] {
    margin-right: 12px;
    accent-color: white;
}

.shipping-rate-info {
    flex: 1;
}

.shipping-rate-service {
    font-size: 14px;
    color: white;
    margin-bottom: 2px;
}

.shipping-rate-estimate {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
}

.shipping-rate-price {
    font-size: 14px;
    font-weight: bold;
    color: white;
}

.shipping-rates-error {
    padding: 12px;
    background: rgba(255, 100, 100, 0.1);
    border: 1px solid rgba(255, 100, 100, 0.3);
    border-radius: 6px;
    color: rgba(255, 150, 150, 1);
    font-size: 13px;
}

.shipping-rates-loading {
    padding: 20px;
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    font-size: 13px;
}

/* Payment Method Section - Stacked Vertically */
.payment-method-section {
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.payment-method-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 12px;
}

.payment-button-row {
    margin-bottom: 10px;
}

.payment-button-row:empty {
    display: none;
}

.payment-card-section {
    margin-top: 10px;
}

.payment-card-toggle {
    width: 100%;
    padding: 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: white;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}

.payment-card-toggle:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Card Fields (Advanced Checkout) */
.paypal-card-form {
    padding: 0;
}

.paypal-card-field {
    margin-bottom: 12px;
}

.paypal-card-field label {
    display: block;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 6px;
}

.paypal-card-field > div {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    padding: 12px;
    min-height: 20px;
}

.paypal-card-row {
    display: flex;
    gap: 12px;
}

.paypal-card-field-half {
    flex: 1;
}

.paypal-card-submit {
    width: 100%;
    padding: 14px;
    background: white;
    color: black;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 8px;
    transition: opacity 0.2s;
}

.paypal-card-submit:hover {
    opacity: 0.9;
}

.paypal-card-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.paypal-divider {
    display: flex;
    align-items: center;
    padding: 0 20px;
    margin: 4px 0;
}

.paypal-divider::before,
.paypal-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.15);
}

.paypal-divider span {
    padding: 0 12px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.4);
}

.paypal-buttons-container {
    padding: 16px 20px;
}

/* Ensure PayPal iframes can receive focus and input */
.paypal-checkout-modal iframe,
.paypal-buttons-container iframe {
    pointer-events: auto !important;
}

.paypal-checkout-footer {
    padding: 12px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.paypal-secure-note {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.4);
}

/* Mobile cart adjustments */
@media (max-width: 768px) {
    .shop-cart {
        bottom: 10px;
        left: 10px;
        right: 10px;
        max-width: none;
    }

    /* Override for mobile shop - always bottom-right */
    body.mobile-global-tabs .shop-cart {
        left: auto !important;
        right: 20px !important;
        bottom: 20px !important;
        max-width: 220px !important;
    }

    /* Hide shop-cart completely on mobile - use mobile cart icon instead */
    body.mobile-global-tabs.safari-entry-mode .shop-cart {
        display: none !important;
    }

    /* Hide tabs when checkout modal is open */
    body.mobile-checkout-open .mobile-global-tabs-bar {
        display: none !important;
    }

    /* Hide cart icon when checkout is open */
    body.mobile-checkout-open .mobile-shop-cart-icon {
        display: none !important;
    }

    /* Ensure checkout modal is above everything */
    body.mobile-checkout-open .paypal-checkout-modal {
        z-index: 20000 !important;
    }

    /* Ensure calculate shipping button is visible on mobile */
    .paypal-calculate-shipping-btn {
        display: block !important;
    }

    /* Ensure mobile shop footer is properly positioned at bottom when shop is active */
    body.mobile-global-tabs .shop-overlay .mobile-shop-footer-row,
    body.mobile-global-tabs.safari-entry-mode .shop-overlay .mobile-shop-footer-row,
    body.mobile-global-tabs:not(.safari-entry-mode) .shop-overlay .mobile-shop-footer-row {
        position: fixed !important;
        bottom: 30px !important;
        left: 20px !important;
        right: 20px !important;
        top: auto !important;
        display: flex !important;
        z-index: 10 !important;
        align-items: flex-end !important;
        justify-content: space-between !important;
    }

    /* Hide footer row when in product detail */
    body.mobile-shop-detail .mobile-shop-footer-row {
        display: none !important;
    }
}

/* Landscape product detail - cart on right side below title */
@media screen and (max-width: 896px) and (orientation: landscape) {
    body.mobile-shop-detail .shop-cart {
        position: fixed !important;
        top: 90px !important;
        bottom: auto !important;
        left: auto !important;
        right: 15px !important;
        transform: none !important;
        width: 120px !important;
        max-width: 120px !important;
        min-width: auto !important;
        text-align: right !important;
        z-index: 100 !important;
    }
}

/* Mobile shop footer — hidden on mobile */
@media (max-width: 1024px) {
    .shop-overlay .mobile-shop-footer-row {
        display: none !important;
    }

    .shop-overlay .mobile-shop-footer {
        display: none !important;
    }
}

/* Folder item styling in inventory grid */
.inventory-item.folder-item {
    background: transparent;
    border: none;
    box-shadow: none;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.inventory-item.folder-item:hover {
    box-shadow: none;
}

.inventory-item.folder-item::before {
    content: "📁";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 48px;
    opacity: 0.8;
}

.inventory-item.folder-item .inventory-item-name {
    position: absolute;
    bottom: 10px;
    left: 0;
    right: 0;
    text-align: center;
    background: rgba(0, 0, 0, 0.8);
    padding: 8px;
    font-size: 14px;
    z-index: 1;
}

/* Mobile-specific: Remove glowing box and position name closer to icon */
@media screen and (max-width: 1024px) {
    .inventory-item.folder-item {
        background: transparent;
        border: none;
        box-shadow: none;
    }
    
    .inventory-item.folder-item:hover {
        box-shadow: none;
    }
    
    .inventory-item.folder-item .inventory-item-name {
        position: absolute;
        top: 40%;
        bottom: auto;
        left: 50%;
        transform: translateX(-50%);
        background: transparent;
        padding: 4px 8px;
        font-size: 10px;
        white-space: normal;
        width: 90%;
        max-width: none;
        text-align: center;
        line-height: 1.3;
    }

    /* Move folder icon up to make room for longer names */
    .inventory-item.folder-item::before {
        top: 25%;
        font-size: 28px;
    }
}

/* Video thumbnail styling in inventory grid */
.inventory-item.video-item {
    background-size: cover;
    background-position: center;
    position: relative;
    width: 150px;
    height: 150px;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

/* Small play icon in bottom right of thumbnail */
.inventory-item.video-item::before {
    content: "▶";
    position: absolute;
    bottom: 8px;
    right: 8px;
    font-size: 16px;
    color: white;
    text-shadow: 0 0 4px rgba(0, 0, 0, 0.8);
    opacity: 0.9;
    z-index: 2;
}

/* Episode number below thumbnail */
.inventory-item.video-item .inventory-item-name {
    position: absolute;
    bottom: -25px;
    left: 0;
    right: 0;
    background: transparent;
    padding: 4px;
    font-size: 12px;
    text-align: center;
    color: white;
    z-index: 1;
}

/* Movie items - same dimensions as video items */
.inventory-item.movie-item {
    background-size: cover;
    background-position: center;
    position: relative;
    width: 150px;
    height: 150px;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.inventory-item.movie-item::before {
    content: "▶";
    position: absolute;
    bottom: 8px;
    right: 8px;
    font-size: 16px;
    color: white;
    text-shadow: 0 0 4px rgba(0, 0, 0, 0.8);
    opacity: 0.9;
    z-index: 2;
}

.inventory-item.movie-item .inventory-item-name {
    position: absolute;
    bottom: -25px;
    left: 0;
    right: 0;
    background: transparent;
    padding: 4px;
    font-size: 12px;
    text-align: center;
    color: white;
    z-index: 1;
}

/* Folder breadcrumb */
.folder-breadcrumb {
    position: fixed;
    top: 140px;
    left: 20px;
    color: white;
    font-size: 14px;
    z-index: 290;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
    background: transparent;
    border: none;
    box-shadow: none;
    border-radius: 0;
    -webkit-appearance: none;
    appearance: none;
}

.folder-breadcrumb:hover {
    opacity: 1;
    background: transparent;
    box-shadow: none;
}

/* Mobile: Condense folder breadcrumb to prevent overflow */
@media screen and (max-width: 768px) {
    .folder-breadcrumb {
        max-width: calc(100% - 40px);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        font-size: 12px;
        top: 55px;
    }
}

/* Desktop: All items same size */
@media screen and (min-width: 1025px) {
    .inventory-item.image-item,
    .inventory-item.video-item,
    .inventory-item.movie-item,
    .inventory-item.text-item,
    .inventory-item.pdf-item-large,
    .inventory-item.folder-item,
    .inventory-item.album-item {
        width: 200px;
        height: 200px;
    }

    /* PDF items should be vertically centered (they're smaller) */
    .inventory-item.pdf-item-large {
        align-self: center;
    }
}

/* Mobile: All items same size */
@media screen and (max-width: 1024px) {
    .inventory-item.image-item,
    .inventory-item.video-item,
    .inventory-item.movie-item,
    .inventory-item.text-item,
    .inventory-item.pdf-item-large,
    .inventory-item.folder-item,
    .inventory-item.album-item {
        width: 80px;
        height: 80px;
    }

    /* Hide video/movie labels on mobile */
    .inventory-item.video-item .inventory-item-name,
    .inventory-item.movie-item .inventory-item-name {
        display: none;
    }

    /* PDF items should be vertically centered on mobile too */
    .inventory-item.pdf-item-large {
        align-self: center;
    }
}
/* Mobile Now Playing Display - Three lines in upper left */
/* Mobile Episode Display - positioned across from channel avatar */
.mobile-now-playing {
    display: none;
    position: fixed;
    top: 60px;
    left: 20px;
    z-index: 200;
    text-align: left;
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
    max-width: calc(100vw - 120px); /* Leave room for avatar on right */
}

.mobile-now-playing.visible {
    opacity: 1;
}

.mobile-episode-title {
    font-size: 28px;
    font-family: 'Times New Roman', Times, serif;
    font-style: italic;
    color: white;
    text-shadow: 0 0 8px rgba(0, 0, 0, 0.8);
    line-height: 1.2;
    margin-bottom: 4px;
}

.mobile-episode-number {
    font-size: 16px;
    color: white;
    text-shadow: 0 0 4px rgba(0, 0, 0, 0.8);
}

/* Only show on mobile */
@media screen and (max-width: 1024px) {
    .mobile-now-playing {
        display: block;
    }
    
    /* Hide in landscape or when index is open */
    body.landscape-mode .mobile-now-playing,
    body.index-open .mobile-now-playing {
        display: none !important;
    }
}

/* Altcomics active — hide age daily text */
body.altcomics-active .age-daily {
    display: none !important;
}

/* UbuWeb landscape fullscreen — hide all UI, just show video */
body.ubuweb-landscape-fullscreen .channel-avatar-container,
body.ubuweb-landscape-fullscreen .channel-info-display,
body.ubuweb-landscape-fullscreen .header-info,
body.ubuweb-landscape-fullscreen .mobile-tv-controls,
body.ubuweb-landscape-fullscreen .mobile-nav-buttons,
body.ubuweb-landscape-fullscreen .mobile-channel-arrows,
body.ubuweb-landscape-fullscreen .swipe-overlay,
body.ubuweb-landscape-fullscreen .yt-blocker,
body.ubuweb-landscape-fullscreen .title-blocker,
body.ubuweb-landscape-fullscreen .bottom-blocker,
body.ubuweb-landscape-fullscreen .safari-channel-tabs,
body.ubuweb-landscape-fullscreen .mobile-global-tabs-bar,
body.ubuweb-landscape-fullscreen .global-channel-title,
body.ubuweb-landscape-fullscreen .landscape-channel-name,
body.ubuweb-landscape-fullscreen #landscapeChannelName,
body.screening-active .channel-source-tag,
body.ubuweb-landscape-fullscreen .channel-source-tag,
body.ubuweb-landscape-fullscreen #homeIndexButtons,
body.ubuweb-landscape-fullscreen .owner-buttons,
body.ubuweb-landscape-fullscreen .mobile-nav-buttons,
body.ubuweb-landscape-fullscreen .typo-controls {
    display: none !important;
}

body.ubuweb-landscape-fullscreen #ubuWebPlayer {
    object-fit: contain;
    z-index: 9999;
}

/* ===== MOBILE: Compact Channel Index ===== */
@media screen and (max-width: 768px) {
    /* Hide current channel info when index is open */
    body.index-open .channel-avatar-container,
    body.index-open .channel-info-name,
    body.index-open .global-channel-title,
    body.index-open #ageDaily {
        display: none !important;
    }

    /* Hide the Age Daily header inside the index */
    body.index-open .channel-index-global {
        display: none !important;
    }

    /* Index overlay — transparent, below tabs, above bottom nav */
    body.index-open .channel-index-overlay {
        top: 45px !important;
        bottom: 70px !important;
        background: transparent !important;
        overflow-y: auto !important;
    }

    /* Make video cover transparent so video shows through */
    body.index-open .video-cover {
        background: transparent !important;
    }

    /* Hide channel tabs when index is open on mobile */
    body.index-open .safari-channel-tabs {
        display: none !important;
    }

    /* Index tabs layout on mobile — left align */
    body.index-open .channel-index-overlay .channel-index-tabs {
        padding: 5px 10px !important;
        justify-content: flex-start !important;
    }

    /* Hide via tag when index is open */
    body.index-open .channel-source-tag,
    body.index-open .channel-source-tag.visible {
        display: none !important;
    }

    /* Hide Age Daily link in index tabs on mobile */
    body.index-open .channel-index-ad-link {
        display: none !important;
    }

    /* Clock avatar mobile styling — white face, electric blue hands/border */
    .channel-index-item-grid .age-daily-clock {
        border-color: #0088ff !important;
        background: white !important;
    }
    .age-daily-clock svg line {
        stroke: #0088ff !important;
    }
    .age-daily-clock svg circle {
        fill: #0088ff !important;
    }

    /* Keep mobile nav buttons above everything */
    body.index-open .mobile-nav-buttons {
        z-index: 500 !important;
    }
}

/* ===== DESKTOP: Avatar Hover Display ===== */
/* Highlight info appears below avatar on hover */
.avatar-hover-highlight {
    display: none;
    position: fixed;
    top: 130px;
    right: 20px;
    color: white;
    font-size: 14px;
    text-align: right;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    text-shadow: 0 0 8px rgba(0, 0, 0, 0.8);
    z-index: 249;
    max-width: 300px;
}

.avatar-hover-highlight .highlight-label {
    font-weight: normal;
    margin-bottom: 4px;
    color: var(--channel-accent);
}

.avatar-hover-highlight .highlight-title {
    font-weight: bold;
    text-decoration: underline;
    margin-bottom: 2px;
}

.avatar-hover-highlight .highlight-type {
    font-style: italic;
    font-weight: normal;
    opacity: 0.9;
    margin-bottom: 2px;
}

.avatar-hover-highlight .highlight-date-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    margin-top: 12px;
    color: var(--channel-accent);
}

.avatar-hover-highlight .highlight-star {
    font-size: 14px;
}

.avatar-hover-highlight .highlight-date {
    font-weight: normal;
}

.avatar-hover-highlight .highlight-time {
    color: var(--channel-accent);
    font-weight: normal;
}

/* Desktop only - show hover elements */
@media screen and (min-width: 1025px) {
    .avatar-hover-highlight {
        display: block;
    }

    .avatar-hover-external-link {
        display: block;
        top: 280px;
    }

    /* COMMENTED OUT: TV shape experiment - to revisit later
    .channel-avatar-container::after {
        content: '';
        position: fixed;
        top: 20px;
        right: -1px;
        width: 120px;
        height: 160px;
        pointer-events: none;
        z-index: 248;
        clip-path: polygon(
            0% 0%,
            100% 0%,
            100% 100%,
            94% 100%,
            94% 94%,
            6% 94%,
            6% 100%,
            0% 100%
        );
    }

    .channel-avatar-container::before {
        content: '';
        position: fixed;
        top: -50px;
        left: auto;
        right: 39px;
        width: 60px;
        height: 70px;
        background: var(--channel-accent);
        pointer-events: none;
        z-index: 247;
        transform: none;
        clip-path: polygon(
            46% 100%,
            0% 0%,
            8% 0%,
            48% 90%,
            52% 90%,
            92% 0%,
            100% 0%,
            54% 100%
        );
    }

    .channel-avatar-container:hover::after {
        pointer-events: auto;
    }
    */

    /* Show elements on container hover */
    .channel-avatar-container:hover .avatar-hover-highlight,
    .channel-avatar-container:hover .avatar-hover-external-link {
        opacity: 1;
        pointer-events: auto;
    }

    /* Keep external link visible when hovering it directly */
    .avatar-hover-external-link:hover {
        opacity: 1;
        pointer-events: auto;
    }

    /* Hide hover elements when inventory/index is open or item viewing */
    .channel-avatar-container.item-viewing .avatar-hover-highlight,
    .channel-avatar-container.item-viewing .avatar-hover-external-link,
    .inventory-overlay.visible ~ .channel-avatar-container .avatar-hover-highlight,
    .inventory-overlay.visible ~ .channel-avatar-container .avatar-hover-external-link,
    .channel-index-overlay.visible ~ .channel-avatar-container .avatar-hover-highlight,
    .channel-index-overlay.visible ~ .channel-avatar-container .avatar-hover-external-link {
        display: none !important;
    }
}

/* ============================================================================
   NOTES VIEWING MODE
   ============================================================================ */

.notes-viewing-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 5; /* Same as pocket - above player, below UI controls */
    background: black;
    display: none;
    user-select: text;
    -webkit-user-select: text;
    touch-action: manipulation;
    overflow-x: hidden;
    overflow-y: auto;
}

.notes-viewing-overlay.active {
    display: block;
}

/* White background mode for canvas */
.notes-viewing-overlay.white-bg {
    background: #ffffff;
}

.notes-viewing-overlay.white-bg .notes-island-text,
.notes-viewing-overlay.white-bg .notes-rich-content,
.notes-viewing-overlay.white-bg .notes-island-transcription {
    color: #111111;
}

.notes-viewing-overlay.white-bg .notes-close-btn {
    color: rgba(0, 0, 0, 0.3);
}

.notes-viewing-overlay.white-bg .notes-close-btn:hover {
    color: rgba(0, 0, 0, 0.6);
}

.notes-viewing-overlay.white-bg .note-edit-btn,
.notes-viewing-overlay.white-bg .note-delete-btn {
    background: rgba(220, 220, 220, 0.9);
    color: #333;
    border-color: rgba(0, 0, 0, 0.2);
}

.notes-viewing-overlay.white-bg .inline-edit-toolbar {
    background: rgba(240, 240, 240, 0.95);
    border-color: rgba(0, 0, 0, 0.2);
}

.notes-viewing-overlay.white-bg .inline-edit-btn {
    color: #333;
}

/* Canvas tabs in white canvas mode (container is at body level) */
body:has(.notes-viewing-overlay.white-bg) .canvas-tab {
    color: rgba(0, 0, 0, 0.5);
}

body:has(.notes-viewing-overlay.white-bg) .canvas-tab:hover {
    color: rgba(0, 0, 0, 0.8);
}

body:has(.notes-viewing-overlay.white-bg) .canvas-tab.active {
    color: #111;
    border-bottom-color: #111;
}

/* Channel info in white canvas mode */
.channel-info.canvas-white-bg,
.channel-info.canvas-white-bg .channel-info-name,
.channel-info.canvas-white-bg .channel-info-links,
.channel-info.canvas-white-bg .channel-info-pocket,
.channel-info.canvas-white-bg .channel-info-notes,
.channel-info.canvas-white-bg .channel-info-about {
    color: #111111 !important;
}

/* Bottom blocker in white canvas mode */
.swipe-overlay-blocker.canvas-white-bg {
    background: linear-gradient(to top, #ffffff 0%, rgba(255, 255, 255, 0) 100%) !important;
}

/* Transparent canvas background - hide blocker */
.swipe-overlay-blocker.canvas-transparent-bg {
    display: none !important;
}

/* Semi-transparent notes during screening - must be above screening overlay */
.notes-viewing-overlay.screening-active {
    background: rgba(0, 0, 0, 0.85);
    z-index: 99998; /* Above screening overlay (z-index: 6) */
}

/* Hide swipe overlay when notes are active */
.notes-viewing-overlay.active ~ .swipe-overlay,
body:has(.notes-viewing-overlay.active) .swipe-overlay,
.pocket-viewing-overlay.active ~ .swipe-overlay,
body:has(.pocket-viewing-overlay.active) .swipe-overlay,
body:has(.pause-overlay.active) .swipe-overlay {
    pointer-events: none;
}

/* Hide title blocker when pocket viewing is active (especially for PDFs on mobile) */
body:has(.pocket-viewing-overlay.active) .title-blocker {
    display: none;
}

/* Hide title blocker when notes viewing is active (for layers button visibility) */
body:has(.notes-viewing-overlay.active) .title-blocker {
    display: none;
}

/* Hide avatar and hover elements when notebook is open */
body:has(.notes-viewing-overlay.active) .channel-avatar-container {
    display: none !important;
}

/* Close button - subtle, upper-right */
.notes-close-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 20;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.3);
    font-size: 24px;
    cursor: pointer;
    padding: 10px;
    line-height: 1;
    transition: color 0.2s ease;
}

.notes-close-btn:hover {
    color: rgba(255, 255, 255, 0.7);
}

/* =========================
   MOBILE: Single Note View
   ========================= */

.notes-mobile-view {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    z-index: 1; /* Below canvas tabs */
}

.notes-mobile-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: safe center;
    padding: 40px 25px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    /* For swipe animations */
    will-change: transform, opacity;
    position: relative;
}

/* Mobile note delete button - positioned relative to the voice memo */
.notes-mobile-delete {
    position: absolute;
    top: -12px;
    right: -12px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #c83c3c;
    border: 2px solid white;
    color: white;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.notes-mobile-delete.visible {
    opacity: 1;
    pointer-events: auto;
}

.notes-mobile-delete:active {
    background: rgba(220, 40, 40, 1);
    transform: scale(0.95);
}

/* Selected state for mobile voice notes - subtle highlight on inner content */
.notes-mobile-voice.selected .notes-mobile-voice-word,
.notes-mobile-audio-only.selected .notes-mobile-audio-icon {
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.4);
}

/* Text note on mobile - matches pocket-text-content styling */
.notes-mobile-text {
    max-width: 800px;
    max-height: 90vh;
    color: white;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 20px;
    line-height: 1.7;
    text-align: center;
    padding: 20px;
}

/* Editable mobile note styling */
.notes-mobile-text[contenteditable="true"]:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.notes-mobile-text[contenteditable="true"]:hover {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 4px;
}

/* Rich note on mobile (embedded images + text) */
.notes-mobile-rich {
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    color: white;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 20px;
    line-height: 1.7;
    text-align: left;
    padding: 20px;
}

.notes-mobile-rich img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 10px 0;
    display: block;
}

/* Image note on mobile */
.notes-mobile-image {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    max-width: 90vw;
    max-height: 80vh;
}

.notes-mobile-image img {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    image-rendering: auto;
    image-rendering: -webkit-optimize-contrast;
    filter: grayscale(1) contrast(1.2) invert(1);
}

/* Voice note on mobile - single word display */
.notes-mobile-voice {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px;
    position: relative;
}

/* Date and duration label */
.notes-mobile-voice-label {
    color: rgba(255, 255, 255, 0.5);
    font-family: Arial, sans-serif;
    font-size: 14px;
    margin-bottom: 30px;
    text-align: center;
}

.notes-mobile-voice-word {
    color: white;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 48px;
    font-weight: 400;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.1s ease;
    text-align: center;
    padding: 0 20px;
}

.notes-mobile-voice-controls {
    margin-top: 40px;
    display: flex;
    gap: 20px;
}

.notes-voice-play-btn {
    background: transparent;
    border: none;
    color: white;
    font-size: 32px;
    cursor: pointer;
    padding: 10px;
}

.notes-voice-play-btn:hover {
    opacity: 0.8;
}

/* Navigation indicator */
.notes-mobile-nav {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
}

.notes-nav-indicator {
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
    font-style: italic;
}

/* Note date display */
.notes-date {
    color: rgba(255, 255, 255, 0.4);
    font-size: 12px;
    font-family: Arial, sans-serif;
    margin-bottom: 20px;
}

/* =========================
   DESKTOP: Islands Layout
   ========================= */

.notes-desktop-view {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: auto; /* Enable both horizontal and vertical scroll */
    -webkit-overflow-scrolling: touch;
    touch-action: manipulation; /* Allow scroll and pinch-zoom */
    cursor: grab; /* Show grab cursor for drag navigation */
    z-index: 1; /* Below canvas tabs */
}

.notes-desktop-view.grabbing {
    cursor: grabbing;
    user-select: none;
}

/* Placement mode cursors */
.notes-desktop-view.placement-mode {
    cursor: crosshair;
}

.notes-desktop-view.placement-text {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='white' stroke='black' stroke-width='1'%3E%3Cpath d='M20.71 7.04c.39-.39.39-1.04 0-1.41l-2.34-2.34c-.37-.39-1.02-.39-1.41 0l-1.84 1.83 3.75 3.75M3 17.25V21h3.75L17.81 9.93l-3.75-3.75L3 17.25z'/%3E%3C/svg%3E") 2 22, crosshair;
}

.notes-desktop-view.placement-image {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='white' stroke='black' stroke-width='1'%3E%3Crect x='3' y='3' width='18' height='18' rx='2' ry='2'/%3E%3Ccircle cx='8.5' cy='8.5' r='1.5'/%3E%3Cpath d='M21 15l-5-5L5 21'/%3E%3C/svg%3E") 12 12, crosshair;
}

/* Drag mode cursor - show grab on draggable items */
.notes-text-draggable,
.notes-voice-draggable {
    cursor: grab;
}

.notes-text-draggable:active,
.notes-voice-draggable:active {
    cursor: grabbing;
}

/* For non-owners, images should allow grab-to-pan through them */
.notes-desktop-view:not(.owner-mode) .notes-island-image img {
    pointer-events: none;
}

.notes-desktop-scroll {
    position: relative; /* For absolutely positioned notes */
    width: 100%;
    padding: 40px 0 50vh 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 200vh; /* Extra height for absolutely positioned notes */
    -webkit-font-smoothing: subpixel-antialiased;
    touch-action: manipulation; /* Allow scroll and pinch-zoom */
    overflow: visible;
}

/* Fixed viewport for standard info tab (not legacy canvas) */
.notes-viewing-overlay.info-mode:not(.legacy-canvas-mode) {
    overflow: hidden;
    background: transparent;
}

.notes-viewing-overlay.info-mode:not(.legacy-canvas-mode) .notes-desktop-scroll {
    overflow: hidden;
    width: 100vw;
    height: 100vh;
    min-height: 100vh;
    padding: 0;
}

/* Info Profile Display - centered in info tab */
.info-profile-display {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 50; /* Below draggable images */
    text-align: center;
    max-width: 450px;
    padding: 30px;
    pointer-events: none; /* Allow clicking through to background */
}

.info-profile-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.info-profile-name {
    display: none; /* Name not shown in info profile */
}

.info-profile-details {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
}

.info-profile-details span:empty {
    display: none;
}

.info-profile-details span:not(:empty) + span:not(:empty)::before {
    content: " · ";
    color: rgba(255, 255, 255, 0.4);
}

.info-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-top: 4px;
}

.info-links:empty {
    display: none;
}

.info-links a {
    color: var(--channel-accent, #ff4444);
    text-decoration: none;
    font-size: 14px;
    pointer-events: auto;
    transition: opacity 0.2s ease;
}

.info-links a:hover {
    opacity: 0.8;
    text-decoration: underline;
}

.info-bio {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.7;
    margin-bottom: 16px;
    font-family: Georgia, 'Times New Roman', serif;
}

.info-bio:empty {
    display: none;
}

.info-bio:empty + .info-profile-details {
    margin-top: 0;
}

.info-cv {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
    text-align: center;
    max-height: 180px;
    overflow-y: auto;
    margin-top: 12px;
    line-height: 1.8;
}

.info-cv:empty {
    display: none;
}

.info-cv::-webkit-scrollbar {
    width: 3px;
}

.info-cv::-webkit-scrollbar-track {
    background: transparent;
}

.info-cv::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
}

/* Mobile info-only mode: text and links only, no images */
.notes-viewing-overlay.mobile-info-only {
    overflow: hidden;
}

.notes-viewing-overlay.mobile-info-only .notes-desktop-scroll,
.notes-viewing-overlay.mobile-info-only .notes-mobile-content,
.notes-viewing-overlay.mobile-info-only .desktop-notes-container,
.notes-viewing-overlay.mobile-info-only .canvas-tabs,
.notes-viewing-overlay.mobile-info-only .layers-panel,
.notes-viewing-overlay.mobile-info-only .notebook-toolbar {
    display: none !important;
}

.notes-viewing-overlay.mobile-info-only .info-profile-display {
    display: block !important;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 400px;
}

.info-cv-entry {
    margin-bottom: 6px;
}

/* Legacy canvas tabs - positioned bottom center above channel controls */
.legacy-canvas-tabs {
    position: fixed;
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.6);
    padding: 8px 14px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.legacy-canvas-tab {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: rgba(255, 255, 255, 0.8);
    padding: 6px 14px;
    border-radius: 14px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.legacy-canvas-tab:hover {
    background: rgba(255, 255, 255, 0.25);
}

.legacy-canvas-tab.active {
    background: var(--channel-accent, rgba(255, 255, 255, 0.4));
    color: white;
}

/* When notes has content, add top padding for first note */
.notes-desktop-scroll .notes-island:first-child {
    margin-top: 35vh;
}

/* Each note is an "island" - spaced apart */
.notes-island {
    margin-bottom: 60px;
    width: 100%;
    text-align: center;
    position: relative;
}

/* Image notes go below text/voice notes */
.notes-island.notes-island-type-image {
    z-index: 1;
}

.notes-island.notes-island-type-text,
.notes-island.notes-island-type-voice {
    z-index: 10;
}

/* First note gets more space below to feel isolated */
.notes-island:first-child {
    margin-bottom: 150px;
}

.notes-island:last-child {
    margin-bottom: 0;
}

/* Text note island - matches pocket-text-content */
.notes-island-text {
    color: white;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 20px;
    line-height: 1.7;
    user-select: text;
    -webkit-user-select: text;
    cursor: text;
    text-align: center;
    display: inline-block;
    max-width: 100%;
}

/* Editable note styling for owners */
.notes-island-text[contenteditable="true"]:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    padding: 10px;
    margin: -10px;
}

.notes-island-text[contenteditable="true"]:hover {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 4px;
    padding: 10px;
    margin: -10px;
}

/* Rich note island (embedded images + text) */
.notes-island-rich {
    position: relative;
    max-width: 600px;
    padding-bottom: 20px; /* Space for edit button */
}

.notes-rich-content {
    color: white;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 20px;
    line-height: 1.7;
    text-align: left;
}

.notes-rich-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 10px 0;
    display: block;
}

/* ============================================================================
   LAYERS PANEL
   ============================================================================ */

.layers-toggle-btn {
    position: fixed;
    top: 20px;
    left: 20px;
    width: 36px;
    height: 36px;
    background: rgba(20, 20, 20, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: white;
    cursor: pointer;
    z-index: 265;
    display: none;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.layers-toggle-btn:hover {
    background: rgba(40, 40, 40, 0.95);
    border-color: var(--channel-accent);
}

.layers-toggle-btn.active {
    border-color: var(--channel-accent);
    background: rgba(var(--channel-accent-rgb, 255, 0, 0), 0.2);
}

.layers-toggle-btn svg {
    stroke: currentColor;
}

/* Canvas Settings Button (below layers button) */
.canvas-settings-btn {
    position: fixed;
    top: 62px;
    left: 20px;
    width: 28px;
    height: 28px;
    background: rgba(20, 20, 20, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    color: white;
    cursor: pointer;
    z-index: 265;
    display: none;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.canvas-settings-btn:hover {
    background: rgba(40, 40, 40, 0.95);
    border-color: var(--channel-accent);
}

.canvas-settings-btn.active {
    border-color: var(--channel-accent);
}

.canvas-settings-btn svg {
    stroke: currentColor;
}

/* Canvas Settings Popup */
.canvas-settings-popup {
    position: fixed;
    top: 62px;
    left: 54px;
    background: rgba(20, 20, 20, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    z-index: 266;
    display: none;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.canvas-settings-popup.visible {
    display: flex;
}

.canvas-settings-option {
    padding: 8px 16px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
    white-space: nowrap;
}

.canvas-settings-option:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.canvas-settings-option.active {
    color: var(--channel-accent);
}

/* Show canvas settings button when owner is viewing notes */
body.owner-mode .notes-viewing-overlay.active .canvas-settings-btn {
    display: flex;
}

.layers-panel {
    position: fixed;
    top: 20px;
    left: 64px;
    width: 200px;
    max-height: 400px;
    background: rgba(20, 20, 20, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    z-index: 260;
    display: none;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.layers-panel.visible {
    display: flex;
}

.layers-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.3);
}

.layers-panel-title {
    color: white;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.layers-panel-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.2s ease;
}

.layers-panel-close:hover {
    color: white;
}

.layers-panel-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
    max-height: 280px;
}

.layers-panel-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    cursor: pointer;
    transition: background 0.15s ease;
    gap: 8px;
}

.layers-panel-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.layers-panel-item.selected {
    background: rgba(255, 0, 0, 0.15);
    border-left: 3px solid var(--channel-accent);
    padding-left: 9px;
}

.layers-panel-item.dragging {
    opacity: 0.5;
    background: rgba(255, 255, 255, 0.1);
}

.layers-panel-item.drag-over {
    background: rgba(255, 255, 255, 0.15);
    border-top: 2px solid var(--channel-accent);
}

.layers-panel-item.unlayered {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 8px;
    padding-top: 12px;
}

/* Multi-select checkbox */
.layer-checkbox {
    width: 14px;
    height: 14px;
    margin: 0;
    cursor: pointer;
    flex-shrink: 0;
    accent-color: var(--channel-accent);
}

/* Multi-selected layer highlight */
.layers-panel-item.multi-selected {
    background: rgba(100, 150, 255, 0.2);
    border-left: 3px solid #6699ff;
    padding-left: 9px;
}

.layers-panel-item.multi-selected.selected {
    background: rgba(100, 150, 255, 0.3);
}

/* Merge button bar */
.layers-merge-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: rgba(100, 150, 255, 0.15);
    border-bottom: 1px solid rgba(100, 150, 255, 0.3);
    margin-bottom: 4px;
}

.layers-merge-btn {
    background: #6699ff;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
}

.layers-merge-btn:hover {
    background: #5588ee;
}

.layers-merge-cancel {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 18px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}

.layers-merge-cancel:hover {
    color: white;
}

/* Inline text editor toolbar */
.inline-toolbar-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 4px 8px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 13px;
    font-family: inherit;
    min-width: 28px;
    transition: all 0.15s ease;
}

.inline-toolbar-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
}

.inline-toolbar-btn:active {
    background: rgba(255, 255, 255, 0.3);
}

.inline-toolbar-save {
    background: rgba(100, 200, 100, 0.3);
    border-color: rgba(100, 200, 100, 0.5);
}

.inline-toolbar-save:hover {
    background: rgba(100, 200, 100, 0.5);
}

.inline-toolbar-cancel {
    background: rgba(200, 100, 100, 0.3);
    border-color: rgba(200, 100, 100, 0.5);
}

.inline-toolbar-cancel:hover {
    background: rgba(200, 100, 100, 0.5);
}

.inline-toolbar-select {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 4px 6px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    font-family: inherit;
}

.inline-toolbar-select option {
    background: #222;
    color: white;
}

.inline-toolbar-divider {
    width: 1px;
    background: rgba(255, 255, 255, 0.2);
    margin: 0 4px;
}

.layer-visibility-btn {
    background: none;
    border: none;
    font-size: 14px;
    cursor: pointer;
    padding: 2px;
    opacity: 1;
    transition: opacity 0.2s ease;
    flex-shrink: 0;
}

.layer-visibility-btn.hidden {
    opacity: 0.3;
}

.layer-name {
    flex: 1;
    color: white;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.layer-name-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--channel-accent);
    border-radius: 3px;
    color: white;
    font-size: 13px;
    padding: 2px 6px;
    outline: none;
}

.layer-note-count {
    color: rgba(255, 255, 255, 0.4);
    font-size: 11px;
    flex-shrink: 0;
}

.layer-delete-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.3);
    font-size: 16px;
    cursor: pointer;
    padding: 0 4px;
    opacity: 0;
    transition: opacity 0.2s ease, color 0.2s ease;
    flex-shrink: 0;
}

.layers-panel-item:hover .layer-delete-btn {
    opacity: 1;
}

.layer-delete-btn:hover {
    color: #ff4444;
}

/* Layer expand button */
.layer-expand-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 10px;
    cursor: pointer;
    padding: 2px 4px;
    margin-right: 4px;
    transition: color 0.15s ease;
}

.layer-expand-btn:hover {
    color: rgba(255, 255, 255, 0.9);
}

.layer-expand-btn.expanded {
    color: rgba(255, 255, 255, 0.8);
}

/* Layer items list (expanded) */
.layer-items-list {
    padding: 4px 0 8px 28px;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    margin-left: 16px;
}

.layer-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.15s ease, color 0.15s ease;
}

.layer-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.layer-item.selected {
    background: rgba(var(--channel-accent-rgb, 255, 0, 0), 0.25);
    color: white;
    border-left: 2px solid var(--channel-accent);
    padding-left: 8px;
}

.layer-item-icon {
    font-size: 12px;
    flex-shrink: 0;
}

.layer-item-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.layer-item-empty {
    padding: 6px 10px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.4);
    font-style: italic;
}

.layer-item-delete {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.3);
    font-size: 14px;
    cursor: pointer;
    padding: 0 4px;
    margin-left: auto;
    opacity: 0;
    transition: opacity 0.15s ease, color 0.15s ease;
}

.layer-item:hover .layer-item-delete {
    opacity: 1;
}

.layer-item-delete:hover {
    color: #ff4444;
}

.layer-item-edit {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    padding: 2px 4px;
    font-size: 12px;
    margin-left: auto;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.layer-item:hover .layer-item-edit {
    opacity: 1;
}

.layer-item-edit:hover {
    color: var(--channel-accent, #4a9eff);
}

/* Inline edit toolbar */
.inline-edit-toolbar {
    position: fixed;
    display: none;
    background: rgba(40, 40, 40, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    padding: 4px;
    gap: 2px;
    z-index: 10001;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.inline-edit-toolbar.visible {
    display: flex;
}

.inline-edit-btn {
    background: none;
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.inline-edit-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Divider between button groups */
.inline-edit-divider {
    width: 1px;
    height: 20px;
    background: rgba(255, 255, 255, 0.2);
    margin: 0 4px;
}

/* Text note resize handles */
.notes-text-resize-handle {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 8px;
    cursor: ew-resize;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 10;
}

.notes-text-resize-left {
    left: -4px;
}

.notes-text-resize-right {
    right: -4px;
}

.notes-island-text-wrapper:hover .notes-text-resize-handle {
    opacity: 1;
}

.notes-text-resize-handle::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 4px;
    height: 30px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 2px;
}

.notes-text-resize-handle:hover::after {
    background: var(--channel-accent, #4a9eff);
}

/* Inline editing state - on the wrapper */
.notes-island-text-wrapper.inline-editing,
.notes-island-rich.inline-editing,
.notes-island-voice.inline-editing {
    cursor: default !important;
}

/* Hide delete button while editing */
.notes-island-text-wrapper.inline-editing .note-delete-btn,
.notes-island-rich.inline-editing .note-delete-btn,
.notes-island-voice.inline-editing .note-delete-btn {
    display: none !important;
}

/* Content editable state */
.content-editable {
    outline: 2px solid var(--channel-accent, #4a9eff);
    outline-offset: 4px;
    background: rgba(0, 0, 0, 0.3);
    min-height: 40px;
    padding: 8px;
    border-radius: 4px;
    cursor: text !important;
    user-select: text;
    -webkit-user-select: text;
}

.content-editable:focus {
    outline: 2px solid var(--channel-accent, #4a9eff);
}

/* Edit button in editing mode (shows as "done") */
.note-edit-btn.editing {
    background: var(--channel-accent, #4a9eff);
    color: white;
    border-color: var(--channel-accent, #4a9eff);
    opacity: 1 !important;
    pointer-events: auto !important;
}

/* Highlight pulse animation for scrolling to items */
@keyframes highlight-pulse {
    0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.8); }
    50% { box-shadow: 0 0 20px 10px rgba(255, 255, 255, 0.4); }
    100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
}

.notes-island.highlight-pulse {
    animation: highlight-pulse 1.5s ease-out;
}

.layers-panel-actions {
    padding: 8px 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.layers-action-btn {
    width: 100%;
    padding: 8px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    color: white;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.layers-action-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Show layers button only when notes view is active in owner mode on desktop (free design mode only) */
body.owner-mode .notes-viewing-overlay.active .layers-toggle-btn {
    display: flex;
}

/* Hide layers panel and canvas settings on mobile */
@media screen and (max-width: 768px) {
    .layers-panel,
    .layers-toggle-btn,
    .canvas-settings-btn,
    .canvas-settings-popup {
        display: none !important;
    }
}

/* Image note on desktop */
.notes-island-image {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    max-width: 1000px;
    width: fit-content;
}

.notes-island-image img {
    display: block;
    max-width: 100%;
    max-height: 70vh;
    width: 100%;
    height: auto;
    object-fit: contain;
    image-rendering: auto;
    image-rendering: -webkit-optimize-contrast;
    filter: grayscale(1) contrast(1.2) invert(1);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    transform: translateZ(0);
}

/* Image filter - inverted for ink drawing aesthetic */
.notes-image-inverted {
    filter: invert(1) brightness(1.1);
}

/* Image filter - normal colors (no inversion) */
.notes-image-color {
    filter: none !important;
}

/* Draggable image notes (owner mode) */
.notes-image-draggable {
    cursor: grab;
    position: relative;
    transition: box-shadow 0.2s ease;
}

.notes-image-draggable:hover {
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
}

.notes-image-draggable:active {
    cursor: grabbing;
}

/* Image wrapper - positions resize handle relative to image */
.notes-image-wrapper {
    position: relative;
    display: inline-block;
    width: 100%;
}

/* Resize handle - bottom right corner of image */
.notes-image-resize-handle {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 16px;
    height: 16px;
    cursor: nwse-resize;
    opacity: 0.6;
    transition: opacity 0.2s ease;
    z-index: 10;
    background: transparent;
}

.notes-image-resize-handle::before {
    content: '';
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 8px;
    height: 8px;
    border-right: 2px solid rgba(255, 255, 255, 0.9);
    border-bottom: 2px solid rgba(255, 255, 255, 0.9);
}

.notes-image-draggable:hover .notes-image-resize-handle,
.notes-image-draggable:active .notes-image-resize-handle {
    opacity: 1;
}

/* Image caption */
.notes-image-caption {
    color: rgba(255, 255, 255, 0.7);
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 14px;
    font-style: italic;
    margin-top: 15px;
    text-align: center;
}

/* Empty state styling - both positioned consistently */
.notes-empty-state,
.pocket-empty-state {
    color: rgba(255, 255, 255, 0.4);
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 18px;
    font-style: italic;
    text-align: center;
    grid-column: 1 / -1;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    min-height: auto;
}

.pocket-empty-state.pocket-loading {
    animation: pocket-loading-pulse 1.5s ease-in-out infinite;
}

@keyframes pocket-loading-pulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 0.7; }
}

/* Canvas loading state */
.canvas-loading-state {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
    animation: pocket-loading-pulse 1.5s ease-in-out infinite;
}

/* Notes empty state needs special positioning since its parent has width: max-content */
.notes-empty-state {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
}

/* Draggable text notes (owner mode) */
.notes-text-draggable {
    cursor: grab;
    position: relative;
}

.notes-text-draggable:active {
    cursor: grabbing;
}

/* Draggable voice notes (owner mode) */
.notes-voice-draggable {
    cursor: grab;
}

.notes-voice-draggable:active {
    cursor: grabbing;
}

/* Voice note island */
.notes-island-voice {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 400px;
    max-width: 90vw;
    padding-bottom: 20px; /* Space for edit button */
}

/* Audio box - consistent for all voice memos (with or without transcription) */
.notes-island-audio-box {
    display: flex;
    align-items: center;
    gap: 20px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.notes-island-audio-box:hover {
    background: rgba(255, 255, 255, 0.06);
}

/* Waveform player area - shows animated bars and subtitle overlay during playback */
.notes-island-waveform {
    position: relative;
    flex: 1;
    height: 120px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.notes-waveform-bars {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    height: 70px;
    padding: 0 10px;
}

.notes-waveform-bar {
    width: 3px;
    min-height: 4px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 2px;
    transition: height 0.05s ease;
}

.notes-waveform-subtitle {
    position: absolute;
    bottom: 10px;
    left: 10px;
    right: 10px;
    text-align: center;
    color: white;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 16px;
    line-height: 1.4;
    background: rgba(0, 0, 0, 0.8);
    padding: 8px 12px;
    border-radius: 4px;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 10;
    pointer-events: none;
}

.notes-waveform-subtitle.visible {
    opacity: 1;
}

.subtitle-word-active {
    color: #fff;
    font-weight: 600;
}

/* Progress bar for audio playback */
.notes-progress-bar-container {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 0 0 8px 8px;
}

.notes-progress-bar {
    height: 100%;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 0 0 0 8px;
    width: 0%;
    transition: width 0.1s linear;
}

/* Drag handle for voice memos with transcription */
.notes-voice-drag-handle {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 18px;
    cursor: grab;
    opacity: 0.4;
    transition: opacity 0.2s ease;
    user-select: none;
    z-index: 10;
}

.notes-voice-drag-handle:hover {
    opacity: 1;
}

.notes-voice-drag-handle:active {
    cursor: grabbing;
}

.notes-island-transcription {
    color: white;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 20px;
    line-height: 1.9;
    user-select: text;
    -webkit-user-select: text;
    cursor: text;
    flex: 1;
}

/* Individual word spans for highlighting */
.notes-word {
    transition: background-color 0.1s ease, color 0.1s ease;
    padding: 2px 0;
    border-radius: 2px;
}

.notes-word.active {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
}

.notes-word.past {
    color: rgba(255, 255, 255, 0.6);
}

/* Play button for desktop voice notes */
.notes-island-play {
    display: flex;
    align-items: center;
    cursor: pointer;
    flex-shrink: 0;
    padding-top: 6px;
}

.notes-island-play-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 28px;
    cursor: pointer;
    padding: 8px;
    transition: all 0.2s ease;
}

.notes-island-play-btn:hover {
    color: white;
}

.notes-island-play-btn.playing {
    color: white;
}

.notes-island-duration {
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
    font-family: Arial, sans-serif;
}

/* Island date */
.notes-island-date {
    color: rgba(255, 255, 255, 0.3);
    font-size: 13px;
    font-family: Arial, sans-serif;
    margin-bottom: 20px;
}

/* Note delete button - appears on hover, positioned inside transformed container */
.note-delete-btn {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(200, 60, 60, 0.9);
    border: 2px solid white;
    color: white;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notes-island {
    position: relative;
}

/* Containers that hold delete button need position: relative */
/* Z-index: images below text/audio for collage layering */
.notes-island-image {
    position: relative;
    z-index: 1;
}

.notes-island-text-wrapper,
.notes-island-voice {
    position: relative;
    z-index: 10;
}

/* Text wrapper - fit content width with small padding */
.notes-island-text-wrapper {
    position: relative;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    max-width: 800px;
    padding: 8px 12px 20px 12px; /* Extra bottom padding for edit button */
    border-radius: 4px;
}

.notes-island:hover .note-delete-btn,
.notes-island-image:hover .note-delete-btn,
.notes-island-text-wrapper:hover .note-delete-btn,
.notes-island-voice:hover .note-delete-btn {
    opacity: 1;
}

.note-delete-btn:hover {
    background: #e74c3c;
    transform: scale(1.1);
}

/* Edit button - minimalist text button inline with content on right */
.note-edit-btn {
    position: absolute;
    bottom: 8px;
    right: 0;
    background: rgba(40, 40, 40, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    color: rgba(255, 255, 255, 0.7);
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 12px;
    cursor: pointer;
    padding: 4px 10px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, color 0.2s ease, background 0.2s ease;
    z-index: 10;
}

/* Show edit button on hover of the wrapper */
.notes-island-text-wrapper:hover .note-edit-btn,
.notes-island-rich:hover .note-edit-btn,
.notes-island-voice:hover .note-edit-btn {
    opacity: 1;
    pointer-events: auto;
}

.note-edit-btn:hover {
    background: rgba(60, 60, 60, 0.95);
    color: white;
}

/* Audio-only notes (no transcription) - Desktop */
.notes-island-audio-only {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 25px 30px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.notes-island-audio-only:hover {
    background: rgba(255, 255, 255, 0.1);
}

.notes-audio-play-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 28px;
    cursor: pointer;
    padding: 8px;
    transition: all 0.2s ease;
    flex-shrink: 0;
    order: 1;
}

.notes-audio-play-btn:hover,
.notes-audio-play-btn.playing {
    color: white;
}

.notes-audio-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-shrink: 0;
    min-width: 160px;
    max-width: 220px;
}

.notes-audio-title {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    font-family: Arial, sans-serif;
    line-height: 1.4;
}

.notes-audio-duration {
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
    font-family: Arial, sans-serif;
}

/* Audio-only notes - Mobile */
.notes-mobile-audio-only {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    width: auto;
    height: auto;
    cursor: pointer;
    position: relative;
    padding: 30px;
}

.notes-mobile-audio-icon {
    color: rgba(255, 255, 255, 0.6);
    transition: color 0.2s ease;
}

.notes-mobile-audio-icon.playing {
    color: white;
}

.notes-mobile-audio-title {
    color: white;
    font-size: 24px;
    font-family: Georgia, 'Times New Roman', serif;
    text-align: center;
}

.notes-mobile-audio-duration {
    color: rgba(255, 255, 255, 0.5);
    font-size: 16px;
    font-family: Arial, sans-serif;
}

/* Responsive: Show scroll view on both mobile and desktop */
.notes-mobile-view {
    display: none !important;
}
.notes-desktop-view {
    display: block;
}

/* Mobile adjustments - simple vertical stacking, no collage */
@media screen and (max-width: 768px) {
    .notes-desktop-view {
        overflow-y: auto;
        overflow-x: hidden; /* No horizontal scroll on mobile */
        cursor: auto; /* No grab cursor on mobile */
    }

    .notes-desktop-scroll {
        padding: 0 0 50vh 0;
        width: 100%;
        min-width: unset;
        align-items: stretch;
    }

    /* Scale canvas down on mobile to fit desktop-positioned items */
    .notes-viewing-overlay.legacy-canvas-mode .notes-desktop-scroll {
        transform: scale(var(--canvas-mobile-scale, 0.5));
        transform-origin: top left;
        width: calc(100% / var(--canvas-mobile-scale, 0.5));
        align-items: center;
    }

    .notes-desktop-scroll .notes-island:first-child {
        margin-top: 140px; /* Below avatar area */
    }

    /* First item text needs to be centered on screen */
    .notes-desktop-scroll .notes-island.notes-island-type-text:first-child {
        margin-top: 35vh;
    }

    .notes-island {
        margin-bottom: 2px; /* Very close stacking for images */
        width: 100%;
        text-align: center;
    }

    /* Text items need more space to appear centered/isolated */
    .notes-island.notes-island-type-text {
        margin-top: 30vh;
        margin-bottom: 30vh;
    }

    /* But consecutive text items shouldn't double up margins */
    .notes-island.notes-island-type-text + .notes-island.notes-island-type-text {
        margin-top: 0;
    }

    /* Single text item should be centered vertically, not pushed low */
    .notes-island.notes-island-type-text:only-child {
        margin-top: 20vh;
        margin-bottom: 0;
    }

    /* Voice memo subtitle - center of screen on mobile */
    .notes-waveform-subtitle {
        position: fixed;
        top: 50%;
        left: 10%;
        right: 10%;
        bottom: auto;
        transform: translateY(-50%);
        font-size: 20px;
    }

    /* Remove transforms on mobile - no collage positioning */
    .notes-island-image,
    .notes-island-text-wrapper,
    .notes-island-voice {
        transform: none !important;
        width: 100% !important;
        max-width: 100%;
    }

    .notes-island-image {
        margin: 0;
        width: auto !important;
        height: auto !important;
    }

    .notes-island-image img {
        width: 100%;
        max-width: 100%;
        height: auto !important;
        max-height: none;
        display: block; /* Remove any inline spacing */
    }

    /* Keep resize handle visible on mobile for touch resizing */
    .notes-image-resize-handle {
        opacity: 0.7;
        width: 32px;
        height: 32px;
        bottom: -4px;
        right: -4px;
    }

    .notes-image-resize-handle::before {
        width: 12px;
        height: 12px;
        bottom: 4px;
        right: 4px;
    }

    /* Disable cursor styles on mobile (touch instead) */
    .notes-image-draggable,
    .notes-text-draggable,
    .notes-voice-draggable {
        cursor: auto;
    }

    /* Delete button on mobile - simple white X, no background */
    .note-delete-btn {
        right: 10px;
        top: 10px;
        width: auto;
        height: auto;
        background: none;
        border: none;
        border-radius: 0;
        color: white;
        font-size: 24px;
        opacity: 0;
        pointer-events: none;
    }

    /* Only show delete button when item is selected */
    .notes-island.selected .note-delete-btn {
        opacity: 1;
        pointer-events: auto;
    }

    /* Disable hover-based showing on mobile */
    .notes-island:hover .note-delete-btn,
    .notes-island-image:hover .note-delete-btn,
    .notes-island-text-wrapper:hover .note-delete-btn,
    .notes-island-voice:hover .note-delete-btn {
        opacity: 0;
        pointer-events: none;
    }

    .notes-island.selected:hover .note-delete-btn {
        opacity: 1;
        pointer-events: auto;
    }

    /* Mobile edit button - only visible when selected */
    .note-edit-btn {
        display: none; /* Hide edit button on mobile */
    }

    .notes-island-text {
        font-size: 17px;
        padding: 0 10px;
    }

    .notes-island-transcription {
        font-size: 17px;
    }
}

/* Channel info notes link styling (matches pocket link) */
.channel-info-notes {
    font-size: 12px;
    opacity: 0.8;
    text-decoration: underline;
    cursor: pointer;
    display: block;
    transition: opacity 0.3s ease;
    pointer-events: auto;
    position: relative;
    z-index: 250;
    padding: 8px;
    margin: -8px;
    color: white;
}

.channel-info-notes:hover {
    opacity: 1;
}

.channel-info-notes:active {
    transform: scale(0.95);
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

/* Notebook is desktop-only */
@media screen and (max-width: 768px) {
    .channel-info-notes {
        display: none !important;
    }
}

/* ============================================================================
   OWNER MODE - Add buttons and editor
   ============================================================================ */

/* Circular add button (+ in circle) - matches nav button style */
.owner-add-btn {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.4);
    color: rgba(255, 255, 255, 0.7);
    font-size: 28px;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
    transition: all 0.2s ease;
}

.owner-add-btn:hover {
    border-color: white;
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

.owner-add-btn span {
    line-height: 1;
    margin-top: -2px;
}

/* Notes image button - positioned to the right of the add note button */
.notes-image-btn {
    left: calc(50% + 70px) !important;
}

.notes-image-btn svg {
    stroke: currentColor;
}

/* Owner Buttons - quill, rec, and pocket add */
/* Desktop: bottom center. Mobile: top-left opposite avatar */
/* Use MANAGED channel accent color (not viewed channel) */
.owner-buttons {
    position: fixed;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 20px;
    z-index: 250;
    --owner-btn-color: var(--managed-accent, #c41e3a);
}

/* Owner buttons use MANAGED channel accent color */
.owner-btn {
    border-color: var(--managed-accent, #c41e3a) !important;
    opacity: 1 !important;
}

.owner-btn svg {
    stroke: var(--managed-accent, #c41e3a) !important;
}

.owner-btn .rec-dot {
    background: var(--managed-accent, #c41e3a) !important;
}

.owner-btn.rec.recording .rec-dot {
    background: #ff3b30 !important;
}

.owner-btn.add-pocket span,
.owner-btn.add-menu span {
    color: var(--managed-accent, #c41e3a) !important;
}

/* Text-style owner buttons (broadcast manager, settings) */
.owner-btn-text {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background: transparent;
    color: var(--managed-accent, #c41e3a);
    border: 1px solid var(--managed-accent, #c41e3a);
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-family: Arial, sans-serif;
    cursor: pointer;
    text-transform: lowercase;
    transition: background-color 0.2s ease;
    line-height: 1.2;
    box-sizing: border-box;
    white-space: nowrap;
}

.owner-btn-text:hover {
    background: color-mix(in srgb, var(--managed-accent, #c41e3a) 10%, transparent);
}

.owner-btn-text:active {
    background: color-mix(in srgb, var(--managed-accent, #c41e3a) 20%, transparent);
}

/* ============================================
   OWNER CHANNEL SELECTOR
   Dropdown to select which channel to manage
   ============================================ */

.owner-channel-selector {
    position: fixed;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 450;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.owner-channel-selector.visible {
    opacity: 1;
    pointer-events: auto;
}

/* Show channel selector when index is open via CSS (body.index-open is added by openChannelIndex) */
body.index-open .owner-channel-selector[data-ready="true"] {
    opacity: 1;
    pointer-events: auto;
}

.owner-channel-current {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid var(--managed-accent, rgba(255, 255, 255, 0.3));
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.owner-channel-current:hover {
    background: rgba(0, 0, 0, 0.85);
    border-color: var(--managed-accent, white);
}

.owner-channel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--managed-accent, white);
}

.owner-channel-name {
    color: var(--managed-accent, white);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.3px;
}

.owner-channel-arrow {
    color: var(--managed-accent, white);
    font-size: 10px;
    opacity: 0.7;
    margin-left: 2px;
}

.owner-channel-dropdown {
    position: absolute;
    bottom: 100%;
    left: 0;
    margin-bottom: 8px;
    background: rgba(20, 20, 20, 0.95);
    border: 1px solid var(--managed-accent, rgba(255, 255, 255, 0.3));
    border-radius: 12px;
    padding: 8px 0;
    min-width: 150px;
    display: none;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.owner-channel-dropdown.open {
    display: block;
}

.owner-channel-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.owner-channel-option:hover {
    background: rgba(255, 255, 255, 0.08);
}

.owner-channel-option.active {
    background: rgba(255, 255, 255, 0.05);
}

.owner-channel-option-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.owner-channel-option-name {
    font-size: 13px;
    color: white;
    font-weight: 400;
}

.owner-channel-option.active .owner-channel-option-name {
    font-weight: 600;
}

/* Mobile: position to the right of tabs at top */
@media screen and (max-width: 768px) {
    .owner-channel-selector {
        bottom: auto;
        top: 15px;
        left: auto;
        right: 15px;
        transform: none;
    }

    .owner-channel-dropdown {
        bottom: auto;
        top: 100%;
        left: auto;
        right: 0;
        margin-bottom: 0;
        margin-top: 8px;
    }

    .owner-channel-current {
        padding: 6px 10px;
    }

    .owner-channel-name {
        font-size: 12px;
    }
}

/* Mobile: position top-left opposite avatar */
@media screen and (max-width: 768px) {
    .owner-buttons {
        bottom: auto;
        top: 60px;
        left: 20px;
        transform: none;
        gap: 12px;
        z-index: 10000 !important; /* Above everything on mobile */
        pointer-events: auto !important;
    }

    .owner-btn {
        width: 38px;
        height: 38px;
        pointer-events: auto !important;
    }

    .owner-btn.quill svg,
    .owner-btn.programming svg {
        width: 16px;
        height: 16px;
    }

    .owner-btn.rec .rec-dot {
        width: 14px;
        height: 14px;
    }

    .owner-btn.add-pocket span {
        font-size: 20px;
    }

    /* LIVE button on mobile - keep text visible */
    .owner-btn.live {
        width: auto !important;
        height: 38px !important;
        padding: 0 10px !important;
        display: flex !important;
        align-items: center;
        justify-content: center;
    }

    .owner-btn.live span {
        font-size: 11px;
    }

    .owner-btn.image-note svg {
        width: 16px;
        height: 16px;
    }

    .owner-btn.notebook svg,
    .owner-btn.pocket svg,
    .owner-btn.popcorn svg,
    .owner-btn.image svg {
        width: 16px;
        height: 16px;
    }

    /* Disabled/greyed out owner buttons on mobile */
    .owner-btn.disabled {
        opacity: 0.3;
        pointer-events: none;
    }

    /* Text buttons on mobile - smaller and more compact */
    .owner-btn-text {
        font-size: 11px;
        padding: 6px 10px;
        height: auto;
        min-height: 38px;
    }

    /* Hide notebook input bar on mobile - we use the main owner buttons instead */
    .notebook-input-bar {
        display: none !important;
    }
}

/* Owner Notebook Buttons - shown when notebook is open */
.owner-notebook-buttons {
    position: fixed;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 20px;
    z-index: 10001;
}

@media screen and (max-width: 768px) {
    .owner-notebook-buttons {
        bottom: auto;
        top: 60px;
        left: 20px;
        transform: none;
        gap: 12px;
    }
}

/* Notebook Input Bar - positioned like main owner buttons */
.notebook-input-bar {
    position: fixed;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 10001;
}

/* Text section - left side */
.notebook-text-section {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Quill button - no circle */
.notebook-quill-btn {
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.7;
    transition: opacity 0.2s ease;
    padding: 0;
}

.notebook-quill-btn:hover {
    opacity: 1;
}

.notebook-quill-btn svg {
    width: 20px;
    height: 20px;
    stroke: var(--managed-accent);
}

/* Text field wrapper with expand button */
.notebook-text-field-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.notebook-text-field {
    width: 180px;
    height: 36px;
    padding: 0 32px 0 12px;
    background: rgba(30, 30, 30, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 18px;
    color: white;
    font-size: 13px;
    font-family: inherit;
    outline: none;
}

.notebook-text-field::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.notebook-text-field:focus {
    border-color: var(--managed-accent);
}

/* Expand button inside text field */
.notebook-expand-btn {
    position: absolute;
    right: 8px;
    width: 20px;
    height: 20px;
    background: transparent;
    border: none;
    cursor: pointer;
    opacity: 0.4;
    transition: opacity 0.2s ease;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notebook-expand-btn:hover {
    opacity: 0.8;
}

.notebook-expand-btn svg {
    width: 12px;
    height: 12px;
    stroke: var(--managed-accent);
}

.notebook-post-btn {
    background: transparent;
    border: none;
    color: var(--managed-accent);
    font-size: 14px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s ease;
    padding: 0;
}

.notebook-post-btn:hover {
    opacity: 1;
}

/* Notebook action buttons - no circles, clean icons */
.notebook-action-btn {
    width: 44px;
    height: 44px;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.7;
    transition: opacity 0.2s ease;
    padding: 0;
}

.notebook-action-btn:hover {
    opacity: 1;
}

.notebook-action-btn svg {
    width: 20px;
    height: 20px;
    stroke: var(--managed-accent);
}

.notebook-action-btn.image-btn svg {
    width: 18px;
    height: 18px;
}

.notebook-action-btn.rec-btn {
    border: 2px solid var(--managed-accent);
    border-radius: 50%;
}

.notebook-action-btn.rec-btn .rec-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--managed-accent);
    transition: all 0.3s ease;
}

.notebook-action-btn.rec-btn.recording {
    border-color: #ff3b30;
    background: rgba(255, 59, 48, 0.15);
}

.notebook-action-btn.rec-btn.recording .rec-dot {
    width: 12px;
    height: 12px;
    background: #ff3b30;
    animation: pulse-recording 1.5s ease-in-out infinite;
}

/* Image section - right side */
.notebook-image-section {
    display: flex;
    align-items: center;
    gap: 8px;
}

.notebook-image-url-field {
    width: 140px;
    height: 36px;
    padding: 0 12px;
    background: rgba(30, 30, 30, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 18px;
    color: white;
    font-size: 13px;
    font-family: inherit;
    outline: none;
}

.notebook-image-url-field::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.notebook-image-url-field:focus {
    border-color: var(--managed-accent);
}

.notebook-add-image-btn {
    background: transparent;
    border: none;
    color: var(--managed-accent);
    font-size: 14px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s ease;
    padding: 0;
}

.notebook-add-image-btn:hover {
    opacity: 1;
}

.notebook-clear-btn {
    background: transparent;
    color: var(--managed-accent);
    border: 1px solid var(--managed-accent);
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-family: Arial, sans-serif;
    cursor: pointer;
    text-transform: lowercase;
    transition: background-color 0.2s ease;
    margin-left: 35px;
}

.notebook-clear-btn:hover,
.notebook-clear-btn:active {
    background: color-mix(in srgb, var(--managed-accent) 10%, transparent);
}

/* Mobile: Reposition and adjust sizing */
@media screen and (max-width: 768px) {
    .notebook-input-bar {
        bottom: auto;
        top: 60px;
        left: 15px;
        right: 15px;
        transform: none;
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }

    .notebook-text-field {
        width: 140px;
    }

    .notebook-image-url-field {
        width: 100px;
    }
}

/* Notebook Image Uploader Modal */
.notebook-image-uploader {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10002;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notebook-image-uploader-content {
    background: rgba(30, 30, 30, 0.95);
    padding: 25px;
    border-radius: 12px;
    max-width: 400px;
    width: 90%;
}

.notebook-image-uploader-content h3 {
    margin: 0 0 20px 0;
    color: white;
    font-size: 18px;
    font-weight: normal;
}

.owner-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    position: relative;
    overflow: visible;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    user-select: none;
    -webkit-user-select: none;
}

/* Ensure SVGs and spans inside owner buttons don't block touches */
.owner-btn svg,
.owner-btn span {
    pointer-events: none;
}

/* Programming button - playlist/lines icon */
.owner-btn.programming {
    border: 2px solid white;
    opacity: 1;
}

.owner-btn.programming svg {
    width: 20px;
    height: 20px;
    stroke: white;
}

.owner-btn.programming:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.1);
}

/* Quill button - white circle outline with quill icon */
.owner-btn.quill {
    border: 2px solid white;
    opacity: 1;
}

.owner-btn.quill svg {
    width: 20px;
    height: 20px;
    stroke: white;
}

.owner-btn.quill:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.1);
}

.owner-btn.quill:hover svg {
    stroke: white;
}

/* Rec button - iPhone Voice Memo style */
.owner-btn.rec {
    border: 2px solid white;
    opacity: 1;
}

.owner-btn.rec .rec-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: white;
    transition: all 0.3s ease;
}

.owner-btn.rec:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.1);
}

.owner-btn.rec:hover .rec-dot {
    background: white;
}

/* Recording state - red button with smaller dot */
.owner-btn.rec.recording {
    opacity: 1;
    border-color: #ff3b30;
    background: rgba(255, 59, 48, 0.15);
}

.owner-btn.rec.recording .rec-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ff3b30;
    animation: pulse-recording 1.5s ease-in-out infinite;
}

@keyframes pulse-recording {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* LIVE button - for livestreaming */
.owner-btn.live {
    display: flex !important;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(255, 255, 255, 0.6);
    width: auto;
    padding: 0 12px;
    border-radius: 6px;
    height: 36px;
}

.owner-btn.live span {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.8);
}

.owner-btn.live:hover {
    border-color: white;
    background: rgba(255, 255, 255, 0.1);
}

.owner-btn.live:hover span {
    color: white;
}

/* Live streaming active state */
.owner-btn.live.streaming {
    border-color: #ff3b30;
    background: rgba(255, 59, 48, 0.2);
    animation: live-pulse 2s ease-in-out infinite;
}

.owner-btn.live.streaming span {
    color: #ff3b30;
}

@keyframes live-pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(255, 59, 48, 0.4);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(255, 59, 48, 0);
    }
}

/* ============================================
   BROADCAST MANAGER MODAL
   ============================================ */

.broadcast-manager-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
}

.broadcast-manager-content {
    background: #1a1a1a;
    border-radius: 12px;
    width: 90%;
    max-width: 700px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.broadcast-manager-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.broadcast-manager-header h2 {
    margin: 0;
    font-size: 18px;
    color: white;
    font-weight: 500;
}

.broadcast-manager-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.broadcast-manager-close:hover {
    color: white;
}

.broadcast-manager-tabs {
    display: flex;
    gap: 0;
    padding: 0 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.broadcast-manager-tab {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: color 0.2s, border-color 0.2s;
}

.broadcast-manager-tab:hover {
    color: rgba(255, 255, 255, 0.8);
}

.broadcast-manager-tab.active {
    color: var(--managed-accent, #c41e3a);
    border-bottom-color: var(--managed-accent, #c41e3a);
}

.broadcast-manager-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

/* Screenings section */
.bm-screenings-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.bm-screening-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.bm-screening-info {
    flex: 1;
    min-width: 0;
}

.bm-screening-title {
    font-size: 14px;
    color: white;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bm-screening-datetime {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
}

.bm-screening-actions {
    display: flex;
    gap: 8px;
}

.bm-screening-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.7);
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.bm-screening-btn:hover {
    border-color: var(--managed-accent, #c41e3a);
    color: var(--managed-accent, #c41e3a);
}

.bm-screening-btn.delete:hover {
    border-color: #ff3b30;
    color: #ff3b30;
}

.bm-add-screening-btn {
    background: transparent;
    border: 1px dashed rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.5);
    padding: 16px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    width: 100%;
    margin-top: 12px;
    transition: all 0.2s;
}

.bm-add-screening-btn:hover {
    border-color: var(--managed-accent, #c41e3a);
    color: var(--managed-accent, #c41e3a);
}

.bm-empty-state {
    text-align: center;
    padding: 40px 20px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
}

/* Screening form in programming menu */
.bm-screening-form {
    padding: 0;
}

.bm-back-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
    cursor: pointer;
    padding: 0;
    margin-bottom: 16px;
}

.bm-back-btn:hover {
    color: rgba(255, 255, 255, 0.8);
}

.bm-form-title {
    font-size: 16px;
    color: white;
    margin: 0 0 20px 0;
    font-weight: normal;
}

.bm-form-field {
    margin-bottom: 16px;
}

.bm-form-field label {
    display: block;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 6px;
}

.bm-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 14px;
    color: white;
    box-sizing: border-box;
}

.bm-input:focus {
    outline: none;
    border-color: var(--managed-accent, #c41e3a);
}

.bm-hint {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.4);
    margin-top: 4px;
}

.bm-form-row {
    display: flex;
    gap: 12px;
}

.bm-form-row .bm-form-field {
    flex: 1;
}

.bm-thumbnail-grid {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.bm-thumbnail {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: border-color 0.2s;
}

.bm-thumbnail:hover {
    border-color: rgba(255, 255, 255, 0.5);
}

.bm-thumbnail.selected {
    border-color: var(--managed-accent, #c41e3a);
}

.bm-thumbnail-actions {
    display: flex;
    gap: 8px;
}

.bm-btn-small {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.7);
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
}

.bm-btn-small:hover {
    border-color: var(--managed-accent, #c41e3a);
    color: var(--managed-accent, #c41e3a);
}

.bm-form-info {
    margin-top: 16px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.4);
    line-height: 1.5;
}

.bm-form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.bm-btn-cancel {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.7);
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.bm-btn-cancel:hover {
    border-color: rgba(255, 255, 255, 0.5);
    color: white;
}

.bm-btn-save {
    background: var(--managed-accent, #c41e3a);
    border: none;
    color: white;
    padding: 10px 24px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.bm-btn-save:hover {
    opacity: 0.9;
}

/* Event type badges */
.bm-event-type {
    display: inline-block;
    font-size: 9px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 3px;
    margin-right: 8px;
    vertical-align: middle;
}

.bm-event-type-screening {
    background: rgba(100, 100, 255, 0.3);
    color: #8888ff;
}

.bm-event-type-live {
    background: rgba(255, 59, 48, 0.3);
    color: #ff3b30;
}

/* Schedule buttons container */
.bm-schedule-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

/* Playlists section */
.bm-playlists-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.bm-playlist-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: opacity 0.2s;
}

.bm-playlist-item.disabled {
    opacity: 0.5;
}

.bm-playlist-checkbox {
    width: 22px;
    height: 22px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    color: white;
    flex-shrink: 0;
    transition: all 0.2s;
}

.bm-playlist-checkbox.checked {
    background: var(--managed-accent, #c41e3a);
    border-color: var(--managed-accent, #c41e3a);
}

.bm-playlist-checkbox:hover {
    border-color: var(--managed-accent, #c41e3a);
}

.bm-playlist-checkbox.locked {
    cursor: default;
    opacity: 0.7;
}

.bm-playlist-checkbox.locked:hover {
    border-color: var(--managed-accent, #c41e3a);
}

.bm-main-label {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    font-weight: normal;
}

.bm-playlist-info {
    flex: 1;
    min-width: 0;
}

.bm-playlist-name {
    font-size: 14px;
    color: white;
    font-weight: 500;
}

.bm-playlist-url {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.4);
    margin-top: 2px;
    font-family: monospace;
}

.bm-playlist-expand {
    width: 36px;
    height: 36px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s;
}

.bm-playlist-expand svg {
    width: 16px;
    height: 16px;
    stroke: rgba(255, 255, 255, 0.5);
    transition: stroke 0.2s;
}

.bm-playlist-expand:hover {
    border-color: var(--managed-accent, #c41e3a);
    background: rgba(255, 255, 255, 0.05);
}

.bm-playlist-expand:hover svg {
    stroke: var(--managed-accent, #c41e3a);
}

.bm-playlist-manage {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    padding: 6px 12px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s;
}

.bm-playlist-manage:hover {
    border-color: var(--managed-accent, #c41e3a);
    color: var(--managed-accent, #c41e3a);
    background: rgba(255, 255, 255, 0.05);
}

.bm-playback-mode {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.bm-playback-label {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
}

.bm-bubble-selector {
    display: flex;
    gap: 8px;
}

.bm-bubble {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 6px 14px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.bm-bubble:hover {
    border-color: rgba(255, 255, 255, 0.4);
    color: rgba(255, 255, 255, 0.7);
}

.bm-bubble.active {
    background: var(--managed-accent, #c41e3a);
    border-color: var(--managed-accent, #c41e3a);
    color: white;
}

.bm-add-btn {
    background: transparent;
    border: 1px dashed rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.5);
    padding: 14px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    width: 100%;
    margin-top: 12px;
    transition: all 0.2s;
}

.bm-add-btn:hover {
    border-color: var(--managed-accent, #c41e3a);
    color: var(--managed-accent, #c41e3a);
}

.bm-apply-btn {
    background: white;
    border: none;
    color: black;
    padding: 14px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    margin-top: 12px;
    transition: all 0.2s;
}

.bm-apply-btn:hover {
    background: rgba(255, 255, 255, 0.9);
}

/* Mobile adjustments */
@media screen and (max-width: 600px) {
    .broadcast-manager-content {
        width: 95%;
        max-height: 90vh;
    }

    .broadcast-manager-header {
        padding: 12px 16px;
    }

    .broadcast-manager-header h2 {
        font-size: 16px;
    }

    .broadcast-manager-tabs {
        padding: 0 16px;
    }

    .broadcast-manager-tab {
        padding: 10px 12px;
        font-size: 13px;
    }

    .broadcast-manager-body {
        padding: 16px;
    }
}

/* ============================================
   LIVE MENU (from REC button)
   ============================================ */

.live-menu {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(30, 30, 30, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 20px;
    min-width: 240px;
    z-index: 10001;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.live-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.live-menu-header span {
    color: white;
    font-size: 16px;
    font-weight: 600;
}

.live-menu-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.live-menu-close:hover {
    color: white;
}

.live-menu-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.live-menu-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s;
}

.live-menu-option:hover {
    background: rgba(255, 255, 255, 0.1);
}

.live-menu-option input[type="radio"] {
    display: none;
}

.live-menu-option input[type="radio"]:checked + .live-menu-option-icon {
    color: #ff3b30;
}

.live-menu-option input[type="radio"]:checked ~ .live-menu-option-text {
    color: white;
}

.live-menu-option-icon {
    width: 24px;
    height: 24px;
    color: rgba(255, 255, 255, 0.4);
    transition: color 0.2s;
}

.live-menu-option-icon svg {
    width: 100%;
    height: 100%;
}

.live-menu-option-text {
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    transition: color 0.2s;
}

/* Selected state - outline around the option */
.live-menu-option:has(input[type="radio"]:checked) {
    background: rgba(255, 59, 48, 0.15);
    border: 1px solid rgba(255, 59, 48, 0.4);
}

/* Live mode info panel (for DJ instructions etc) */
.live-menu-info {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 12px;
}
.live-menu-info-text {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.5;
}
.live-menu-info-text strong {
    color: white;
}
.live-menu-info-text .browser-note {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
}

.live-menu-go {
    width: 100%;
    padding: 14px;
    background: #ff3b30;
    border: none;
    border-radius: 10px;
    color: white;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.live-menu-go:hover {
    background: #ff4f44;
}

.live-menu-go:active {
    transform: scale(0.98);
}

/* REC button streaming state */
.owner-btn.rec.streaming .rec-dot {
    background: #ff3b30;
    animation: rec-pulse 1s ease-in-out infinite;
}

@keyframes rec-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.2); }
}

/* ============================================
   LIVE STREAM OVERLAY
   ============================================ */

.live-stream-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #000;
    z-index: 10000;
    display: flex;
    flex-direction: column;
}

.live-stream-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 10;
    background: linear-gradient(to bottom, rgba(0,0,0,0.7), transparent);
}

.live-stream-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #ff3b30;
    padding: 6px 12px;
    border-radius: 4px;
}

.live-dot {
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
    animation: live-dot-pulse 1.5s ease-in-out infinite;
}

@keyframes live-dot-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.live-text {
    font-size: 12px;
    font-weight: 700;
    color: white;
    letter-spacing: 0.5px;
}

.live-stream-viewers {
    font-size: 14px;
    color: rgba(255,255,255,0.8);
}

.live-stream-close {
    margin-left: auto;
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.1);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.live-stream-close:hover {
    background: rgba(255,255,255,0.2);
}

#liveStreamVideo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}

/* Audio-only waveform display */
.live-stream-waveform {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
}

.live-waveform-bars {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    height: 200px;
    width: 80%;
    max-width: 600px;
}

.live-waveform-bars .waveform-bar {
    width: 4px;
    background: #ff3b30;
    border-radius: 2px;
    transition: height 0.05s ease;
}

.live-stream-controls {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 20px;
    z-index: 10;
}

.live-control-btn {
    width: 56px;
    height: 56px;
    background: rgba(255,255,255,0.15);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.live-control-btn svg {
    width: 24px;
    height: 24px;
}

.live-control-btn:hover {
    background: rgba(255,255,255,0.25);
}

.live-control-btn.muted {
    background: rgba(255, 59, 48, 0.3);
    position: relative;
}

.live-control-btn.muted svg {
    stroke: #ff3b30;
}

/* Strikethrough line for muted mic/cam */
.live-control-btn.muted::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 15%;
    right: 15%;
    height: 3px;
    background: #ff3b30;
    transform: rotate(-45deg);
    border-radius: 2px;
}

.live-end-btn {
    width: auto;
    padding: 0 24px;
    border-radius: 28px;
    background: #ff3b30;
    font-size: 14px;
    font-weight: 600;
}

.live-end-btn:hover {
    background: #ff5147;
}

/* Flip camera button - mobile only */
.mobile-only-btn {
    display: none;
}
@media (max-width: 768px) {
    .mobile-only-btn {
        display: flex;
    }
}

.live-stream-viewer-msg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.live-stream-waiting {
    color: rgba(255,255,255,0.6);
    font-size: 16px;
}

/* Live mode selector popup */
.live-mode-selector {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #1a1a1a;
    border-radius: 16px;
    padding: 24px;
    z-index: 10001;
    min-width: 280px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.live-mode-title {
    font-size: 18px;
    font-weight: 600;
    color: white;
    text-align: center;
    margin-bottom: 20px;
}

.live-mode-options {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.live-mode-option {
    flex: 1;
    background: rgba(255,255,255,0.1);
    border: 2px solid transparent;
    border-radius: 12px;
    padding: 20px 16px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    color: white;
    transition: all 0.2s ease;
}

.live-mode-option svg {
    width: 32px;
    height: 32px;
    stroke: rgba(255,255,255,0.8);
}

.live-mode-option span {
    font-size: 13px;
    font-weight: 500;
}

.live-mode-option:hover {
    background: rgba(255,255,255,0.15);
    border-color: rgba(255,255,255,0.3);
}

.live-mode-cancel {
    width: 100%;
    padding: 12px;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 8px;
    color: rgba(255,255,255,0.7);
    font-size: 14px;
    cursor: pointer;
}

.live-mode-cancel:hover {
    background: rgba(255,255,255,0.05);
}

/* Live mode info panel (for selector version) */
.live-mode-info {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 12px;
    margin: 0 16px 12px 16px;
}
.live-mode-info-text {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.5;
}
.live-mode-info-text strong {
    color: white;
}
.live-mode-info-text .browser-note {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
}

/* Hide DJ option on mobile (screen sharing not supported) */
@media (max-width: 768px) {
    .desktop-only-option {
        display: none !important;
    }
}

/* Channel live badge - minimal text below avatar */
.channel-live-badge {
    position: fixed;
    top: 130px; /* Below avatar (avatar is at top: 60px, height: 60px) */
    right: 20px;
    width: 60px; /* Match avatar width for centering */
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    padding: 4px 0;
    cursor: pointer;
    z-index: 500;
}

.live-badge-dot {
    display: none;
}

.live-badge-text {
    font-size: 11px;
    font-weight: 600;
    color: var(--channel-accent, rgba(255, 255, 255, 0.7));
    letter-spacing: 1px;
    text-transform: lowercase;
}

/* Hide the duplicate indicator inside the stream overlay */
.live-stream-inline-indicator {
    display: none !important;
}

/* Mobile portrait: center the live badge below avatar */
@media screen and (max-width: 768px) and (orientation: portrait) {
    .channel-live-badge {
        right: auto;
        left: 50%;
        top: 90px; /* Position beneath avatar */
        transform: translateX(-50%);
    }
}

/* Mobile landscape: hide all live indicators */
@media screen and (max-height: 500px) and (orientation: landscape) {
    .channel-live-badge,
    .live-stream-inline-indicator {
        display: none !important;
    }
}

/* Live Stream Prompt (tune in modal) */
.live-stream-prompt {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.live-prompt-content {
    background: #1a1a1a;
    border-radius: 16px;
    padding: 32px 40px;
    text-align: center;
    max-width: 90%;
    width: 340px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.live-prompt-text {
    font-size: 18px;
    color: white;
    margin-bottom: 24px;
    line-height: 1.5;
}

.live-prompt-text #livePromptName {
    color: var(--channel-accent, #ff3b30);
    font-weight: 600;
}

.live-prompt-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.live-prompt-btn {
    padding: 12px 32px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.live-prompt-yes {
    background: var(--channel-accent, #ff3b30);
    color: white;
}

.live-prompt-yes:hover {
    filter: brightness(1.1);
}

.live-prompt-no {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
}

.live-prompt-no:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

/* Join/Exit Livestream Button (lower right corner) */
.live-stream-action-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 10px 16px;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 13px;
    cursor: pointer;
    z-index: 500;
    transition: all 0.2s;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.live-stream-action-btn:hover {
    background: rgba(0, 0, 0, 0.85);
    border-color: var(--channel-accent, #ff3b30);
    color: white;
}

.live-stream-action-btn.live-exit {
    border-color: rgba(255, 59, 48, 0.5);
    color: #ff6b6b;
}

.live-stream-action-btn.live-exit:hover {
    border-color: #ff3b30;
    background: rgba(255, 59, 48, 0.2);
}

/* Mobile adjustments for live buttons */
@media (max-width: 768px) {
    .live-stream-action-btn {
        bottom: 80px;
        right: 16px;
        font-size: 12px;
        padding: 8px 14px;
    }
}

/* ============================================
   INLINE LIVE STREAM (in channel interface)
   ============================================ */

.live-stream-inline {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #000;
    z-index: 5; /* Below UI elements but above YouTube */
}

.live-stream-inline video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.live-stream-inline-waveform {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    align-items: center;
    justify-content: center;
    background: #000;
}

.live-stream-inline-waveform .live-waveform-bars {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    height: 40vh;
    width: 80%;
    max-width: 700px;
}

.live-stream-inline-indicator {
    position: absolute;
    top: 20px;
    left: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: #ff3b30;
    padding: 6px 12px;
    border-radius: 4px;
    z-index: 10;
}

.live-stream-inline-connecting {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: rgba(255, 255, 255, 0.6);
    font-size: 16px;
    display: none;
}

/* Mobile fullscreen button for live stream */
.live-stream-fullscreen-btn {
    display: none; /* Hidden on desktop */
    position: absolute;
    top: 15px;
    right: 15px;
    width: 32px;
    height: 32px;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    z-index: 20;
    padding: 6px;
}

.live-stream-fullscreen-btn .fullscreen-icon-corner {
    position: absolute;
    width: 8px;
    height: 8px;
    border-color: white;
    border-style: solid;
    border-width: 0;
}

.live-stream-fullscreen-btn .fullscreen-icon-corner.tl {
    top: 6px;
    left: 6px;
    border-top-width: 2px;
    border-left-width: 2px;
}

.live-stream-fullscreen-btn .fullscreen-icon-corner.tr {
    top: 6px;
    right: 6px;
    border-top-width: 2px;
    border-right-width: 2px;
}

.live-stream-fullscreen-btn .fullscreen-icon-corner.bl {
    bottom: 6px;
    left: 6px;
    border-bottom-width: 2px;
    border-left-width: 2px;
}

.live-stream-fullscreen-btn .fullscreen-icon-corner.br {
    bottom: 6px;
    right: 6px;
    border-bottom-width: 2px;
    border-right-width: 2px;
}

/* Show on mobile only */
@media screen and (max-width: 1024px) {
    .live-stream-fullscreen-btn {
        display: block;
    }
}

/* Broadcaster controls - floating bar */
.live-stream-broadcaster-controls {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 16px;
    padding: 12px 20px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 30px;
    z-index: 1000;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.live-stream-broadcaster-controls .live-control-btn {
    width: 44px;
    height: 44px;
}

.live-stream-broadcaster-controls .live-control-btn svg {
    width: 20px;
    height: 20px;
}

.live-stream-broadcaster-controls .live-end-btn {
    width: auto;
    padding: 0 20px;
    height: 44px;
    border-radius: 22px;
    font-size: 13px;
}

/* Live viewer display */
.live-viewer-display {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(0, 0, 0, 0.5);
    padding: 8px 14px;
    border-radius: 20px;
    cursor: pointer;
    margin-right: 8px;
}
.live-viewer-count {
    font-size: 16px;
    font-weight: 600;
    color: white;
}
.live-viewer-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
}
.live-viewer-list {
    position: absolute;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.85);
    border-radius: 12px;
    padding: 12px;
    min-width: 180px;
    max-width: 280px;
    max-height: 200px;
    overflow-y: auto;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
.live-viewer-list-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.live-viewer-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: white;
}
.live-viewer-item.anonymous {
    color: rgba(255, 255, 255, 0.6);
    font-style: italic;
}
.live-viewer-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
}
.live-viewer-name {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Add pocket button - just a + sign, no circle */
.owner-btn.add-pocket {
    border: none;
    width: auto;
    height: auto;
    padding: 5px 10px;
}

.owner-btn.add-pocket span {
    font-size: 28px;
    font-weight: 300;
    color: white;
    opacity: 1;
    line-height: 1;
}

.owner-btn.add-pocket:hover span {
    opacity: 1;
}

/* Mobile gear icon - no border */
.owner-btn.settings-icon {
    border: none;
    background: transparent;
    opacity: 0.8;
}

.owner-btn.settings-icon svg {
    width: 22px;
    height: 22px;
    stroke: var(--managed-accent, #c41e3a);
}

.owner-btn.settings-icon:hover,
.owner-btn.settings-icon:active {
    opacity: 1;
}

/* Projector button */
.owner-btn.projector {
    border: none;
    opacity: 0.7;
}

.owner-btn.projector .projector-icon {
    width: 24px;
    height: 24px;
    filter: brightness(0) invert(1);
    opacity: 0.8;
}

.owner-btn.projector:hover {
    opacity: 1;
    background: color-mix(in srgb, var(--channel-accent) 10%, transparent);
}

.owner-btn.projector:hover .projector-icon {
    opacity: 1;
}

/* Notebook button */
.owner-btn.notebook {
    border: 2px solid var(--channel-accent);
    opacity: 0.7;
}

.owner-btn.notebook svg {
    width: 20px;
    height: 20px;
    stroke: var(--channel-accent);
}

.owner-btn.notebook:hover {
    opacity: 1;
    background: color-mix(in srgb, var(--channel-accent) 10%, transparent);
}

/* Pocket button */
.owner-btn.pocket {
    border: 2px solid var(--channel-accent);
    opacity: 0.7;
}

.owner-btn.pocket svg {
    width: 20px;
    height: 20px;
    stroke: var(--channel-accent);
}

.owner-btn.pocket:hover {
    opacity: 1;
    background: color-mix(in srgb, var(--channel-accent) 10%, transparent);
}

/* Popcorn button */
.owner-btn.popcorn {
    border: 2px solid var(--channel-accent);
    opacity: 0.7;
}

.owner-btn.popcorn svg {
    width: 20px;
    height: 20px;
    stroke: var(--channel-accent);
}

.owner-btn.popcorn:hover {
    opacity: 1;
    background: color-mix(in srgb, var(--channel-accent) 10%, transparent);
}

/* Image button (for notebook images) */
.owner-btn.image {
    border: 2px solid var(--channel-accent);
    opacity: 0.7;
}

.owner-btn.image svg {
    width: 20px;
    height: 20px;
    stroke: var(--channel-accent);
}

.owner-btn.image:hover {
    opacity: 1;
    background: color-mix(in srgb, var(--channel-accent) 10%, transparent);
}

/* Image note button - for ink drawings (only shown to users with canUploadNoteImages permission) */
.owner-btn.image-note {
    border: 2px solid var(--channel-accent);
    opacity: 0.7;
}

.owner-btn.image-note svg {
    width: 20px;
    height: 20px;
    stroke: var(--channel-accent);
}

.owner-btn.image-note:hover {
    opacity: 1;
    background: color-mix(in srgb, var(--channel-accent) 10%, transparent);
}

.owner-btn.image-note:hover svg {
    stroke: var(--channel-accent);
}

/* Add menu button (replaces multiple buttons) */
.owner-btn.add-menu {
    opacity: 0.7;
}

.owner-btn.add-menu span {
    font-size: 28px;
    font-weight: 300;
    color: var(--channel-accent);
    line-height: 1;
}

.owner-btn.add-menu:hover {
    opacity: 1;
}

/* Owner menu - dropdown with sections */
/* Uses MANAGED channel accent color */
.owner-menu {
    position: fixed;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.95);
    border: 1px solid var(--managed-accent, rgba(255, 255, 255, 0.3));
    border-radius: 12px;
    padding: 16px 20px;
    z-index: 10001;
    font-family: Arial, sans-serif;
    min-width: 180px;
}

.owner-menu-section {
    margin-bottom: 16px;
}

.owner-menu-section:last-child {
    margin-bottom: 0;
}

.owner-menu-header {
    font-size: 14px;
    font-weight: bold;
    color: var(--managed-accent, white);
    margin-bottom: 10px;
    letter-spacing: 0.5px;
}

.owner-menu-header.owner-menu-link {
    cursor: pointer;
}

.owner-menu-header.owner-menu-link:hover {
    text-decoration: underline;
}

.owner-menu-buttons {
    display: flex;
    gap: 12px;
    align-items: center;
}

.owner-menu-or {
    font-size: 14px;
    font-weight: bold;
    color: var(--managed-accent, white);
    margin-left: 8px;
    letter-spacing: 0.5px;
}

.owner-menu-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1.5px solid var(--managed-accent, rgba(255, 255, 255, 0.5));
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.owner-menu-btn:hover {
    background: color-mix(in srgb, var(--managed-accent, white) 15%, transparent);
}

.owner-menu-btn svg {
    width: 18px;
    height: 18px;
    stroke: var(--managed-accent, white);
}

.owner-menu-btn .rec-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--managed-accent, white);
}

.owner-menu-btn.pdf-btn {
    font-size: 10px;
    font-weight: bold;
    color: var(--managed-accent, white);
    letter-spacing: -0.5px;
}

/* Mobile positioning for owner menu */
@media screen and (max-width: 768px) {
    .owner-menu {
        bottom: auto;
        top: 70px;
        right: 15px;
        left: auto;
    }
}

/* Uploaded message - fades in/out */
.uploaded-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 24px;
    font-style: italic;
    font-family: Georgia, 'Times New Roman', serif;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
}

.uploaded-message.visible {
    opacity: 1;
}

/* Transcribe prompt - Yes/No buttons after upload */
.transcribe-prompt {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10001;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    text-align: center;
    background: rgba(0, 0, 0, 0.9);
    padding: 30px 40px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.transcribe-prompt.visible {
    opacity: 1;
    pointer-events: auto;
}

.transcribe-prompt-text {
    color: white;
    font-size: 22px;
    font-style: italic;
    font-family: Georgia, 'Times New Roman', serif;
    margin-bottom: 20px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
}

.transcribe-prompt-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.transcribe-btn {
    padding: 10px 30px;
    font-size: 16px;
    font-family: Arial, sans-serif;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: transparent;
    color: white;
}

.transcribe-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
}

.transcribe-btn.transcribe-yes {
    background: rgba(255, 255, 255, 0.15);
}

.transcribe-btn.transcribe-yes:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Voice memo form - shown after recording ends */
.voice-memo-form {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10001;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    text-align: center;
    background: rgba(0, 0, 0, 0.95);
    padding: 30px 40px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    min-width: 280px;
}

.voice-memo-form.visible {
    opacity: 1;
    pointer-events: auto;
}

.voice-memo-form-title {
    color: white;
    font-size: 18px;
    font-family: Georgia, 'Times New Roman', serif;
    margin-bottom: 20px;
}

.voice-memo-form-field {
    margin-bottom: 18px;
    text-align: left;
}

.voice-memo-form-field label {
    display: block;
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
    margin-bottom: 6px;
    text-transform: lowercase;
}

.voice-memo-form-field input[type="text"] {
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: white;
    font-family: Arial, sans-serif;
    box-sizing: border-box;
}

.voice-memo-form-field input[type="text"]:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.12);
}

.voice-memo-form-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 24px;
    cursor: pointer;
}

.voice-memo-form-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--channel-accent, #888);
}

.voice-memo-form-checkbox span {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
}

.voice-memo-form-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.voice-memo-form-btn {
    padding: 10px 24px;
    font-size: 14px;
    font-family: Arial, sans-serif;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: transparent;
    color: white;
    text-transform: lowercase;
}

.voice-memo-form-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
}

.voice-memo-form-btn.primary {
    background: rgba(255, 255, 255, 0.15);
}

.voice-memo-form-btn.primary:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Playback waveform overlay - shows during voice note playback */
.playback-waveform-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    display: none;
    z-index: 50;
}

.playback-waveform-overlay.active {
    display: block;
}

.playback-waveform {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    width: 100%;
    height: 100%;
    padding: 0 10%;
    box-sizing: border-box;
}

.playback-waveform .bar {
    flex: 1;
    max-width: 6px;
    min-width: 2px;
    background: var(--channel-accent);
    border-radius: 2px;
    transition: height 0.05s ease;
}

/* Subtitle overlay on playback waveform */
.playback-subtitle {
    position: absolute;
    bottom: 15%;
    left: 10%;
    right: 10%;
    text-align: center;
    color: white;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 24px;
    line-height: 1.5;
    background: rgba(0, 0, 0, 0.7);
    padding: 15px 25px;
    border-radius: 8px;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 10;
}

.playback-subtitle.visible {
    opacity: 1;
}

.playback-subtitle .subtitle-word-active {
    color: var(--channel-accent);
    font-weight: 600;
}

/* Mobile subtitle overlay - just centered text, no waveform */
.mobile-subtitle-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 60;
}

.mobile-subtitle-overlay.active {
    display: flex;
}

.mobile-subtitle {
    color: white;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 48px;
    font-weight: 400;
    text-align: center;
    padding: 20px 40px;
    max-width: 90%;
    line-height: 1.3;
}

/* Recording overlay - shows waveform over player */
.recording-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.recording-overlay.active {
    display: flex;
}

.recording-label {
    position: absolute;
    top: 30%;
    left: 0;
    right: 0;
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    font-family: Arial, sans-serif;
    text-transform: lowercase;
    letter-spacing: 0.5px;
    z-index: 101;
}

.recording-waveform {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    padding: 0 10%;
    box-sizing: border-box;
}

.recording-waveform .bar {
    flex: 1;
    max-width: 6px;
    min-width: 2px;
    background: var(--channel-accent);
    border-radius: 2px;
    transition: height 0.05s ease;
}

.recording-timer {
    position: absolute;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'SF Mono', 'Monaco', monospace;
    font-size: 24px;
    color: rgba(255, 255, 255, 0.8);
    letter-spacing: 2px;
}

.recording-stop-btn {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid var(--channel-accent);
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.recording-stop-btn:hover {
    background: color-mix(in srgb, var(--channel-accent) 20%, transparent);
}

.recording-stop-btn .stop-icon {
    width: 16px;
    height: 16px;
}

/* Voice Playback Overlay - matches recording overlay style */
.voice-playback-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.voice-playback-overlay.active {
    display: flex;
}

.voice-playback-title {
    position: absolute;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 20px;
    color: rgba(255, 255, 255, 0.8);
    text-align: center;
    max-width: 80%;
}

.voice-playback-waveform {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    padding: 0 10%;
    box-sizing: border-box;
}

.voice-playback-waveform .bar {
    flex: 1;
    max-width: 6px;
    min-width: 2px;
    background: var(--channel-accent);
    border-radius: 2px;
    transition: height 0.05s ease;
}

.voice-playback-btn {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid var(--channel-accent);
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    color: var(--channel-accent);
}

.voice-playback-btn:hover {
    background: color-mix(in srgb, var(--channel-accent) 20%, transparent);
}

.voice-playback-btn svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.voice-playback-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.3);
    font-size: 24px;
    cursor: pointer;
    z-index: 10;
    line-height: 1;
    padding: 10px;
    transition: color 0.2s ease;
}

.voice-playback-close:hover {
    color: rgba(255, 255, 255, 0.7);
}

.voice-playback-subtitle {
    position: absolute;
    bottom: 100px;
    left: 10%;
    right: 10%;
    text-align: center;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 24px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.5);
}

.voice-playback-subtitle .active {
    color: white;
}

.recording-option {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
}

.recording-option input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--channel-accent);
}

.recording-option.transcribe-option {
    cursor: pointer;
}

.recording-option.transcribe-option:hover {
    color: rgba(255, 255, 255, 0.9);
}

.recording-limit-warning {
    color: var(--channel-accent);
    font-size: 14px;
    margin-top: 15px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.recording-limit-warning.visible {
    opacity: 1;
}

@keyframes pulse-border {
    0%, 100% { border-color: var(--channel-accent); }
    50% { border-color: color-mix(in srgb, var(--channel-accent) 50%, transparent); }
}

@keyframes pulse-dot {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(0.85); opacity: 0.7; }
}

/* Hide on mobile landscape */
@media (max-width: 768px) and (orientation: landscape) {
    .owner-buttons {
        display: none !important;
    }
}

/* Note Editor Overlay */
.note-editor-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
}

.note-editor-overlay.active {
    display: flex;
}

.note-editor-container {
    width: 90%;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    box-sizing: border-box;
    background: rgba(0, 0, 0, 0.95);
    padding: 25px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    position: relative;
}

.note-editor-content {
    width: 100%;
    min-height: 200px;
    max-height: 60vh;
    overflow-y: auto;
    padding: 20px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 18px;
    line-height: 1.7;
    box-sizing: border-box;
}

.note-editor-content:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.6);
}

.note-editor-content:empty::before {
    content: attr(data-placeholder);
    color: rgba(255, 255, 255, 0.3);
}

/* Embedded images in note editor */
.note-editor-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 10px 0;
    display: block;
}

/* Links in note editor */
.note-editor-content a {
    color: #00b8ff;
    text-decoration: underline;
}

/* Headers in note editor */
.note-editor-content h1 {
    font-size: 28px;
    font-weight: 600;
    margin: 0.5em 0;
}

.note-editor-content h2 {
    font-size: 22px;
    font-weight: 600;
    margin: 0.4em 0;
}

.note-editor-content h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 0.3em 0;
}

/* Legacy textarea support */
.note-editor-container textarea {
    width: 100%;
    min-height: 200px;
    padding: 20px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 18px;
    line-height: 1.7;
    resize: vertical;
    box-sizing: border-box;
}

.note-editor-container textarea:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.6);
}

.note-editor-container textarea::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

/* Note editor close button */
.note-editor-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 28px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
    z-index: 10;
}

.note-editor-close:hover {
    color: white;
}

/* Note editor toolbar */
.note-editor-toolbar {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 8px;
}

.toolbar-btn {
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.toolbar-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

.toolbar-btn svg {
    stroke: currentColor;
}

.toolbar-divider {
    width: 1px;
    height: 24px;
    background: rgba(255, 255, 255, 0.2);
    margin: 0 8px;
}

/* Upload options in note editor */
/* Note editor image section */
.note-editor-image-section {
    margin-bottom: 15px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
}

.note-editor-image-preview {
    margin-bottom: 10px;
    text-align: center;
}

.note-editor-image-preview img {
    max-width: 100%;
    max-height: 150px;
    border-radius: 6px;
}

.note-editor-invert-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
}

.note-editor-invert-label input[type="checkbox"] {
    cursor: pointer;
}

/* Note editor upload row */
.note-editor-upload-row {
    margin-bottom: 15px;
}

.note-editor-upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: transparent;
    border: 1px dashed rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.note-editor-upload-btn:hover {
    border-color: rgba(255, 255, 255, 0.5);
    color: rgba(255, 255, 255, 0.9);
}

.note-editor-upload-btn svg {
    stroke: currentColor;
}

/* Old upload options - kept for backwards compatibility */
.note-editor-upload-options {
    margin-bottom: 15px;
    display: flex;
    gap: 10px;
}

.note-editor-upload-option {
    flex: 1;
    padding: 12px;
    border: 1px dashed rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    text-align: center;
}

.note-editor-upload-option input[type="file"] {
    display: none;
}

.note-editor-upload-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    transition: color 0.2s ease;
}

.note-editor-upload-label:hover {
    color: rgba(255, 255, 255, 0.9);
}

.note-editor-upload-icon {
    font-size: 18px;
}

.note-editor-actions {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
}

.note-editor-cancel,
.note-editor-save {
    padding: 10px 24px;
    font-size: 14px;
    cursor: pointer;
    border: none;
    border-radius: 4px;
}

.note-editor-cancel {
    background: transparent;
    color: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.note-editor-cancel:hover {
    color: white;
    border-color: rgba(255, 255, 255, 0.6);
}

.note-editor-save {
    background: white;
    color: black;
}

.note-editor-save:hover {
    background: rgba(255, 255, 255, 0.9);
}

.note-editor-save:disabled {
    background: rgba(255, 255, 255, 0.3);
    cursor: not-allowed;
}

/* Bottom row: pictures icon left, post button right */
.note-editor-bottom-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
}

.note-editor-pictures-btn {
    width: 44px;
    height: 44px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.note-editor-pictures-btn:hover {
    color: white;
    border-color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.1);
}

/* Voice memo content in pocket viewing */
.pocket-voice-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    max-width: 800px;
    padding: 40px 20px;
    width: 100%;
}

.pocket-voice-title-display {
    font-size: 20px;
    color: rgba(255, 255, 255, 0.9);
    font-family: Georgia, 'Times New Roman', serif;
    margin-bottom: 10px;
}

.pocket-audio-player {
    display: none; /* Hidden, using custom controls */
}

/* Desktop voice playback */
.pocket-voice-desktop {
    gap: 30px;
}

.pocket-voice-waveform-container {
    position: relative;
    width: 100%;
    max-width: 600px;
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pocket-voice-waveform {
    width: 100%;
    height: 100%;
}

.pocket-voice-controls-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.pocket-voice-play-btn-large {
    background: transparent;
    border: none;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    transition: all 0.2s ease;
}

.pocket-voice-play-btn-large:hover {
    color: rgba(255, 255, 255, 0.8);
}

/* Div-based waveform for pocket voice (mirrored style) */
.pocket-voice-waveform-bars {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    width: 100%;
    height: 100%;
    padding: 0 10%;
    box-sizing: border-box;
}

.pocket-voice-waveform-bars .bar {
    flex: 1;
    max-width: 6px;
    min-width: 2px;
    background: var(--channel-accent);
    border-radius: 2px;
    transition: height 0.05s ease;
}

.pocket-voice-subtitles {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 24px;
    line-height: 1.6;
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    min-height: 80px;
    max-width: 700px;
}

.subtitle-word {
    transition: color 0.15s ease;
}

.subtitle-word.active {
    color: white;
    font-weight: 500;
}

.subtitle-word.spoken {
    color: rgba(255, 255, 255, 0.4);
}

/* Mobile voice playback */
.pocket-voice-mobile {
    gap: 20px;
    padding: 30px 20px;
}

.pocket-voice-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    width: 100%;
    max-width: 350px;
}

.pocket-voice-play-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    min-width: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.8);
    transition: all 0.2s ease;
}

.pocket-voice-play-btn:hover,
.pocket-voice-play-btn:active {
    background: rgba(255, 255, 255, 0.2);
}

.pocket-voice-progress-bar {
    flex: 1;
    height: 8px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    cursor: pointer;
    overflow: hidden;
}

.pocket-voice-progress {
    height: 100%;
    width: 0%;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 4px;
    transition: width 0.1s linear;
}

.pocket-voice-transcription {
    color: rgba(255, 255, 255, 0.6);
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 16px;
    line-height: 1.8;
    text-align: center;
    max-height: 50vh;
    overflow-y: auto;
    padding: 0 10px;
}

/* Word highlighting in transcription */
.voice-word {
    transition: color 0.15s ease, background 0.15s ease;
    padding: 2px 0;
}

.voice-word.active {
    color: white;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
    padding: 2px 4px;
    margin: 0 -4px;
}

.voice-word.spoken {
    color: rgba(255, 255, 255, 0.4);
}

/* =============================================
   MOBILE COMPOSER (Tumblr-style)
   ============================================= */
.mobile-composer {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 100000;
    flex-direction: column;
}

.mobile-composer.active {
    display: flex;
}

.mobile-composer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    padding-top: max(12px, env(safe-area-inset-top));
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-composer-close {
    background: transparent;
    border: none;
    color: white;
    font-size: 28px;
    font-weight: 300;
    padding: 0;
    width: 40px;
    height: 40px;
    cursor: pointer;
    line-height: 1;
}

.mobile-composer-post {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: rgba(255, 255, 255, 0.4);
    font-size: 16px;
    font-weight: 500;
    padding: 8px 20px;
    border-radius: 4px;
    cursor: not-allowed;
}

.mobile-composer-post:enabled {
    background: #00b8ff;
    color: white;
    cursor: pointer;
}

.mobile-composer-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 16px;
}

.mobile-composer-text {
    width: 100%;
    min-height: 100px;
    color: white;
    font-size: 18px;
    line-height: 1.5;
    outline: none;
    border: none;
    background: transparent;
}

.mobile-composer-text:empty::before {
    content: attr(data-placeholder);
    color: rgba(255, 255, 255, 0.35);
    pointer-events: none;
}

.mobile-composer-text:focus:empty::before {
    color: rgba(255, 255, 255, 0.25);
}

/* Selected images in body */
.mobile-composer-images {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

.mobile-composer-images:empty {
    display: none;
}

.mobile-composer-image-item {
    position: relative;
    width: calc(50% - 4px);
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
}

.mobile-composer-image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mobile-composer-image-remove {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 24px;
    height: 24px;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Recent photos row - positioned above toolbar */
.mobile-composer-photos {
    position: fixed;
    bottom: 60px; /* Above the toolbar */
    left: 0;
    right: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 12px 0;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
    background: #000;
    z-index: 100001;
}

.mobile-composer-photos-scroll {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 0 16px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}

.mobile-composer-photos-scroll::-webkit-scrollbar {
    display: none;
}

.mobile-composer-photo-thumb {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    scroll-snap-align: start;
    position: relative;
}

.mobile-composer-photo-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mobile-composer-photo-thumb.selected::after {
    content: '';
    position: absolute;
    inset: 0;
    border: 3px solid #00b8ff;
    border-radius: 6px;
    pointer-events: none;
}

.mobile-composer-photo-thumb .thumb-check {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    background: #00b8ff;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
}

.mobile-composer-photo-thumb.selected .thumb-check {
    display: flex;
}

.mobile-composer-photo-thumb .thumb-check svg {
    width: 12px;
    height: 12px;
    stroke: white;
    stroke-width: 3;
}

.mobile-composer-photo-library {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    cursor: pointer;
    scroll-snap-align: start;
}

.mobile-composer-photo-library svg {
    stroke: rgba(255, 255, 255, 0.6);
}

.mobile-composer-photo-library span {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.6);
}

.mobile-composer-photo-library:active {
    background: rgba(255, 255, 255, 0.2);
}

/* Bottom toolbar - always at bottom */
.mobile-composer-toolbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: flex-end; /* Buttons on right side */
    gap: 4px;
    padding: 12px 16px;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: #000;
    z-index: 100002;
}

/* Floating toolbar - hidden by default, appears above keyboard */
.mobile-composer-toolbar-floating {
    display: none;
    z-index: 100003;
}

.mobile-composer-toolbar-floating.visible {
    display: flex;
}

.mobile-composer-tool {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    padding: 8px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    user-select: none;
    -webkit-user-select: none;
}

.mobile-composer-tool:active {
    color: white;
}

.mobile-composer-tool .tool-text {
    font-size: 20px;
    font-weight: 500;
    font-family: Georgia, serif;
}

.mobile-composer-tool svg {
    stroke: currentColor;
}

/* Formatting popup */
.mobile-composer-format-popup {
    display: none;
    position: fixed;
    bottom: 70px;
    left: 16px;
    background: #222;
    border-radius: 8px;
    padding: 8px;
    gap: 4px;
    flex-direction: row;
    align-items: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    z-index: 100003;
}

.mobile-composer-format-popup.visible {
    display: flex;
}

.format-option {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    font-size: 18px;
    padding: 10px 14px;
    cursor: pointer;
    border-radius: 4px;
    min-width: 44px;
    font-family: Georgia, serif;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    user-select: none;
    -webkit-user-select: none;
}

.format-option:active {
    background: rgba(255, 255, 255, 0.15);
}

.format-option strong {
    font-weight: 700;
}

.format-option em {
    font-style: italic;
}

.format-h1 {
    font-size: 20px;
    font-weight: 600;
}

.format-h2 {
    font-size: 17px;
    font-weight: 600;
}

.format-h3 {
    font-size: 14px;
    font-weight: 600;
}

.format-divider {
    width: 1px;
    height: 24px;
    background: rgba(255, 255, 255, 0.2);
    margin: 0 4px;
}

/* Links in mobile composer */
.mobile-composer-text a {
    color: #00b8ff;
    text-decoration: underline;
}

/* Headers in mobile composer */
.mobile-composer-text h1 {
    font-size: 28px;
    font-weight: 600;
    margin: 0.5em 0;
}

.mobile-composer-text h2 {
    font-size: 22px;
    font-weight: 600;
    margin: 0.4em 0;
}

.mobile-composer-text h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 0.3em 0;
}

/* Settings Overlay */
.settings-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    display: none;
    align-items: flex-start;
    justify-content: center;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 40px 0;
    box-sizing: border-box;
}

.settings-overlay.active {
    display: flex;
}

.settings-container {
    width: 90%;
    max-width: 500px;
    background: transparent;
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin: auto;
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.settings-header h2 {
    color: var(--channel-accent);
    font-size: 18px;
    font-weight: normal;
    margin: 0;
    text-transform: lowercase;
}

.settings-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    opacity: 0.7;
}

.settings-close:hover {
    opacity: 1;
}

.settings-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.settings-field label {
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
    text-transform: lowercase;
}

.settings-field input[type="text"] {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 12px;
    font-size: 14px;
    border-radius: 4px;
}

.settings-field input[type="text"]:focus {
    outline: none;
    border-color: var(--channel-accent);
}

.settings-hint {
    color: rgba(255, 255, 255, 0.4);
    font-size: 11px;
}

.settings-avatar-row {
    display: flex;
    gap: 12px;
    align-items: center;
}

.settings-avatar-row input {
    flex: 1;
}

.settings-avatar-preview {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid var(--channel-accent);
    object-fit: cover;
    display: none;
}

.settings-avatar-preview.visible {
    display: block;
}

.settings-color-row {
    display: flex;
    gap: 12px;
    align-items: center;
}

.settings-color-row input[type="color"] {
    width: 50px;
    height: 40px;
    border: none;
    cursor: pointer;
    background: transparent;
    padding: 0;
}

.settings-color-row input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

.settings-color-row input[type="color"]::-webkit-color-swatch {
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

.settings-color-hex {
    color: white;
    font-family: monospace;
    font-size: 14px;
}

.settings-url-row {
    display: flex;
    gap: 0;
    align-items: center;
}

.settings-url-prefix {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-right: none;
    border-radius: 4px 0 0 4px;
    padding: 12px 8px 12px 12px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
}

.settings-url-row input[type="text"] {
    border-radius: 0 4px 4px 0 !important;
    flex: 1;
}

.settings-url-status {
    font-size: 11px;
    margin-top: 6px;
    min-height: 14px;
}

.settings-url-status.checking {
    color: rgba(255, 255, 255, 0.5);
}

.settings-url-status.available {
    color: #4ade80;
}

.settings-url-status.taken {
    color: #ff6b6b;
}

.settings-url-status.current {
    color: rgba(255, 255, 255, 0.5);
}

.settings-color-reset {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.6);
    padding: 6px 12px;
    font-size: 11px;
    cursor: pointer;
    border-radius: 3px;
}

/* Toggle button row (black/white) */
.settings-toggle-row {
    display: flex;
    gap: 8px;
}

.settings-toggle-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.6);
    padding: 8px 16px;
    font-size: 13px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.settings-toggle-btn:hover {
    border-color: rgba(255, 255, 255, 0.5);
    color: white;
}

.settings-toggle-btn.active {
    background: var(--channel-accent, #ff0000);
    border-color: var(--channel-accent, #ff0000);
    color: white;
}

/* Pocket background options */
.settings-pocket-bg-options {
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.settings-pocket-bg-options input[type="color"] {
    width: 50px;
    height: 36px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    cursor: pointer;
    background: transparent;
}

.settings-pocket-bg-options input[type="text"] {
    flex: 1;
    min-width: 200px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 10px 12px;
    font-size: 14px;
    border-radius: 4px;
}

.settings-pocket-bg-options .settings-hint {
    width: 100%;
    margin-top: 4px;
}

.settings-pocket-bg-preview {
    width: 120px;
    height: 68px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    display: none;
}

.settings-pocket-bg-preview.visible {
    display: block;
}

.settings-upload-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.8);
    padding: 10px 16px;
    font-size: 13px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.settings-upload-btn:hover {
    border-color: rgba(255, 255, 255, 0.5);
    color: white;
}

.settings-color-reset:hover {
    border-color: rgba(255, 255, 255, 0.5);
    color: white;
}

.settings-external-link-row {
    display: flex;
    gap: 12px;
    align-items: center;
}

.settings-external-link-row select {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 12px;
    font-size: 14px;
    border-radius: 4px;
    cursor: pointer;
}

.settings-external-link-row select:focus {
    outline: none;
    border-color: var(--channel-accent, red);
}

.settings-external-link-row select option {
    background: #1a1a1a;
    color: white;
}

.settings-external-link-row input {
    flex: 1;
}

.settings-error {
    color: #ff6b6b;
    font-size: 12px;
    margin-top: 4px;
}

.settings-avatar-upload-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.8);
    padding: 12px 16px;
    font-size: 14px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.settings-avatar-upload-btn:hover {
    border-color: var(--preview-accent, var(--channel-accent));
    color: white;
}

.settings-avatar-upload-btn.uploading {
    opacity: 0.6;
    cursor: wait;
}

/* Admin Zone (site admin only) */
.settings-admin-zone {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid rgba(100, 200, 255, 0.3);
}

.settings-admin-header {
    color: rgba(100, 200, 255, 0.8);
    font-size: 12px;
    font-weight: bold;
    text-transform: lowercase;
    margin-bottom: 15px;
}

.settings-admin-btn {
    width: 100%;
    padding: 12px;
    background: rgba(100, 200, 255, 0.15);
    border: 1px solid rgba(100, 200, 255, 0.3);
    color: rgba(100, 200, 255, 0.9);
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    margin-bottom: 8px;
    transition: all 0.2s;
}

.settings-admin-btn:hover {
    background: rgba(100, 200, 255, 0.25);
    border-color: rgba(100, 200, 255, 0.5);
}

.settings-db-status {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 10px;
    padding: 8px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}

.settings-db-status.error {
    color: rgba(255, 100, 100, 0.9);
    background: rgba(255, 100, 100, 0.1);
}

.settings-db-status.success {
    color: rgba(100, 255, 100, 0.9);
    background: rgba(100, 255, 100, 0.1);
}

/* Admin DB Indicator (floating, for hiccups) */
.admin-db-indicator {
    position: fixed;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 100, 100, 0.9);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: bold;
    z-index: 9999;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    animation: pulse-indicator 2s infinite;
}

.admin-db-indicator .db-indicator-dot {
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
    animation: blink 1s infinite;
}

@keyframes pulse-indicator {
    0%, 100% { opacity: 0.9; }
    50% { opacity: 1; }
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* Shop Set Up Zone */
.settings-shop-zone {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid rgba(100, 180, 255, 0.3);
}

.settings-shop-header {
    color: rgba(100, 180, 255, 0.8);
    font-size: 12px;
    font-weight: bold;
    text-transform: lowercase;
    margin-bottom: 15px;
}

.settings-shop-btn {
    width: 100%;
    padding: 12px;
    background: rgba(100, 180, 255, 0.15);
    border: 1px solid rgba(100, 180, 255, 0.3);
    color: rgba(100, 180, 255, 0.9);
    border-radius: 6px;
    cursor: pointer;
}

.settings-shop-btn:hover {
    background: rgba(100, 180, 255, 0.25);
}

.settings-shop-btn.connected {
    background: rgba(100, 255, 150, 0.15);
    border-color: rgba(100, 255, 150, 0.3);
    color: rgba(100, 255, 150, 0.9);
    cursor: default;
}

/* Account Zone */
.settings-account-zone {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.settings-account-header {
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
    font-weight: bold;
    text-transform: lowercase;
    margin-bottom: 15px;
}

.settings-account-zone .settings-field {
    margin-bottom: 0;
}

.settings-account-zone .settings-field input[type="password"] {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 10px;
    font-size: 14px;
    border-radius: 4px;
    margin-bottom: 8px;
}

.settings-account-zone .settings-field input[type="password"]:focus {
    outline: none;
    border-color: var(--channel-accent);
}

.settings-password-btn {
    width: 100%;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: transparent;
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
    margin-top: 8px;
}

.settings-password-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
    color: white;
}

.settings-success {
    color: rgba(100, 255, 100, 0.8);
    font-size: 12px;
    margin-top: 8px;
}

/* Danger Zone */
.settings-danger-zone {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 100, 100, 0.3);
}

.settings-danger-header {
    color: rgba(255, 100, 100, 0.8);
    font-size: 12px;
    font-weight: bold;
    text-transform: lowercase;
    margin-bottom: 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.settings-danger-header:hover {
    color: rgba(255, 100, 100, 1);
}

.settings-danger-arrow {
    font-size: 10px;
    transition: transform 0.2s ease;
}

.settings-danger-arrow.open {
    transform: rotate(180deg);
}

.settings-danger-content {
    padding-top: 10px;
}

.settings-danger-btn {
    width: 100%;
    padding: 12px;
    border: 1px solid rgba(255, 100, 100, 0.5);
    background: transparent;
    color: rgba(255, 100, 100, 0.8);
    font-size: 14px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
    margin-bottom: 8px;
}

.settings-danger-btn:hover {
    background: rgba(255, 100, 100, 0.1);
    border-color: rgba(255, 100, 100, 0.8);
    color: rgba(255, 100, 100, 1);
}

.settings-suspend-btn.suspended {
    background: rgba(255, 200, 100, 0.1);
    border-color: rgba(255, 200, 100, 0.5);
    color: rgba(255, 200, 100, 0.8);
}

.settings-delete-btn:hover {
    background: rgba(255, 50, 50, 0.2);
}

.settings-danger-zone .settings-hint {
    display: block;
    margin-bottom: 15px;
}

.settings-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 12px;
}

.settings-cancel {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 10px 20px;
    cursor: pointer;
    border-radius: 4px;
    font-size: 14px;
}

.settings-cancel:hover {
    border-color: rgba(255, 255, 255, 0.5);
}

.settings-save {
    background: var(--channel-accent);
    border: none;
    color: white;
    padding: 10px 20px;
    cursor: pointer;
    border-radius: 4px;
    font-size: 14px;
}

.settings-save:hover {
    opacity: 0.9;
}

/* Settings Two-Column Layout */
.settings-columns {
    display: flex;
    gap: 40px;
}

.settings-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.settings-column h3 {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
    margin: 0 0 8px 0;
    text-transform: lowercase;
    font-weight: normal;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 8px;
}

/* Wider settings container for two columns */
.settings-container {
    max-width: 720px;
}

/* Settings info links list */
.settings-links-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.settings-link-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.settings-link-row input {
    flex: 1;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 8px 10px;
    font-size: 13px;
    border-radius: 4px;
}

.settings-link-row input:focus {
    outline: none;
    border-color: var(--channel-accent);
}

.settings-link-row input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.settings-link-remove {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    font-size: 18px;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
}

.settings-link-remove:hover {
    color: #ff6b6b;
}

.settings-add-link-btn {
    background: transparent;
    border: 1px dashed rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.6);
    padding: 8px 12px;
    font-size: 12px;
    cursor: pointer;
    border-radius: 4px;
    text-align: left;
    margin-top: 4px;
}

.settings-add-link-btn:hover {
    border-color: rgba(255, 255, 255, 0.5);
    color: white;
}

/* Settings textarea */
.settings-field textarea {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 10px 12px;
    font-size: 13px;
    border-radius: 4px;
    resize: vertical;
    font-family: inherit;
    line-height: 1.5;
}

.settings-field textarea:focus {
    outline: none;
    border-color: var(--channel-accent);
}

.settings-field textarea::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

/* Hide desktop-only elements on mobile */
@media screen and (max-width: 768px) {
    .settings-desktop-only,
    .desktop-only,
    #settingsNotebookBgField {
        display: none !important;
    }

    /* Stack columns on mobile */
    .settings-columns {
        flex-direction: column;
        gap: 30px;
    }

    .settings-container {
        max-width: 500px;
    }
}

/* Pocket Add Button - positioned inside inventory overlay */
.owner-add-btn.pocket-add {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
}

/* Pocket Uploader Overlay */
.pocket-uploader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
}

.pocket-uploader-overlay.active {
    display: flex;
}

.pocket-uploader-container {
    background: var(--channel-accent, rgba(30, 30, 30, 0.98));
    border-radius: 16px;
    padding: 30px 35px;
    display: flex;
    flex-direction: column;
    gap: 25px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.pocket-uploader-header {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    position: relative;
}

.pocket-uploader-header-title {
    color: white;
    font-size: 18px;
    font-weight: normal;
    margin: 0;
}

.pocket-uploader-header-tab {
    color: white;
    font-size: 18px;
    font-weight: normal;
    margin: 0;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.2s ease;
    background: none;
    border: none;
    padding: 0;
    font-family: inherit;
}

.pocket-uploader-header-tab:hover {
    opacity: 0.8;
}

.pocket-uploader-header-tab.active {
    opacity: 1;
}

.pocket-uploader-header-divider {
    color: rgba(255, 255, 255, 0.3);
    font-size: 18px;
}

.pocket-uploader-close {
    position: absolute;
    right: -10px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.pocket-uploader-close:hover {
    color: white;
}

.pocket-uploader-types {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.pocket-type-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px 25px;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pocket-type-btn:hover,
.pocket-type-btn.selected {
    opacity: 0.7;
}

.pocket-type-icon {
    font-size: 28px;
    color: rgba(255, 255, 255, 0.7);
}

.pocket-type-icon svg {
    stroke: rgba(255, 255, 255, 0.7);
}

.pocket-type-btn:hover .pocket-type-icon svg,
.pocket-type-btn.selected .pocket-type-icon svg {
    stroke: white;
}

.pocket-type-label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
}

.pocket-type-btn:hover .pocket-type-label,
.pocket-type-btn.selected .pocket-type-label {
    color: white;
}

/* Desktop-only pocket type buttons */
.pocket-type-desktop-only {
    display: flex;
}

@media (max-width: 768px) {
    .pocket-type-desktop-only {
        display: none;
    }
}

.pocket-uploader-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.pocket-input {
    width: 100%;
    padding: 12px 15px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    font-size: 16px;
    border-radius: 4px;
    box-sizing: border-box;
}

.pocket-input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.6);
}

.pocket-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.pocket-uploader-actions {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 10px;
}

.pocket-uploader-cancel,
.pocket-uploader-save {
    padding: 10px 24px;
    font-size: 14px;
    cursor: pointer;
    border: none;
    border-radius: 4px;
}

.pocket-uploader-cancel {
    background: transparent;
    color: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.pocket-uploader-cancel:hover {
    color: white;
    border-color: rgba(255, 255, 255, 0.6);
}

.pocket-uploader-save {
    background: white;
    color: black;
}

.pocket-uploader-save:hover {
    background: rgba(255, 255, 255, 0.9);
}

.pocket-uploader-save:disabled {
    background: rgba(255, 255, 255, 0.3);
    cursor: not-allowed;
}

/* Or divider */
.pocket-or-divider {
    color: rgba(255, 255, 255, 0.4);
    font-size: 13px;
    text-align: center;
    margin: 10px 0;
}

/* Helper text */
.pocket-helper-text {
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
    display: block;
    margin-top: 8px;
}

/* Save visibility dropdown */
.pocket-visibility-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
}

.pocket-visibility-row label {
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
}

.pocket-visibility-select {
    padding: 6px 12px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    font-size: 13px;
    border-radius: 4px;
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.5)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 14px;
    padding-right: 30px;
}

.pocket-visibility-select:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.6);
}

.pocket-visibility-select option {
    background: #1a1a1a;
    color: white;
}

/* Preview area */
.pocket-preview {
    margin-top: 10px;
}

/* Album images preview grid */
.album-images-preview {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-top: 12px;
    max-height: 200px;
    overflow-y: auto;
}

.album-images-preview .album-preview-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 4px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.1);
}

.album-images-preview .album-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.album-images-preview .album-preview-item .album-preview-remove {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 18px;
    height: 18px;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
}

.album-images-preview .album-preview-item:hover .album-preview-remove {
    opacity: 1;
}

.album-images-count {
    margin-top: 8px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
}

/* Playlist Settings Form */
.playlist-form {
    flex-direction: column;
    gap: 20px;
}

.playlist-mode-toggle {
    display: flex;
    align-items: center;
    gap: 15px;
}

.playlist-mode-label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
}

.playlist-mode-buttons {
    display: flex;
    gap: 0;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    overflow: hidden;
}

.playlist-mode-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    padding: 8px 16px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.playlist-mode-btn:first-child {
    border-right: 1px solid rgba(255, 255, 255, 0.3);
}

.playlist-mode-btn.active {
    background: var(--managed-accent, var(--channel-accent, red));
    color: white;
}

.playlist-mode-btn:hover:not(.active) {
    background: rgba(255, 255, 255, 0.1);
}

.playlist-slots {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.playlist-slots-label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    margin: 0 0 5px 0;
}

.playlist-slot {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Checkbox style for playlist slots */
.playlist-checkbox {
    width: 22px;
    height: 22px;
    border-radius: 4px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.playlist-checkbox:hover {
    border-color: rgba(255, 255, 255, 0.5);
}

.playlist-checkbox .checkbox-check {
    font-size: 14px;
    color: transparent;
    transition: color 0.2s ease;
}

.playlist-checkbox.active {
    border-color: var(--managed-accent, var(--channel-accent, red));
    background: var(--managed-accent, var(--channel-accent, red));
}

.playlist-checkbox.active .checkbox-check {
    color: white;
}

.playlist-slot-input {
    flex: 1;
}

.playlist-slot-input:disabled {
    opacity: 0.5;
}

/* Collab channel option */
.playlist-collab-option {
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 5px;
}

.playlist-checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    cursor: pointer;
}

.playlist-collab-hint {
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
    margin-left: 5px;
}

/* Hide playlist slots when using contributor playlists */
.playlist-slots.hidden {
    display: none;
}

/* Micromanage button in playlist slots */
.playlist-micromanage-btn {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.3);
    color: rgba(255,255,255,0.5);
    padding: 6px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: border-color 0.2s, color 0.2s;
    flex-shrink: 0;
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    min-width: 32px;
    justify-content: center;
    align-items: center;
}
.playlist-micromanage-btn:hover {
    border-color: var(--managed-accent, var(--channel-accent));
    color: var(--managed-accent, var(--channel-accent));
    opacity: 1 !important;
    visibility: visible !important;
}
.playlist-micromanage-btn:disabled {
    opacity: 0.3 !important;
    cursor: not-allowed;
}

/* Playlist Editor Modal */
.playlist-editor-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
}
.playlist-editor-content {
    background: #1a1a1a;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(255,255,255,0.1);
}
.playlist-editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.playlist-editor-header h2 {
    margin: 0;
    font-size: 18px;
    color: white;
}
.playlist-editor-close {
    background: none;
    border: none;
    color: rgba(255,255,255,0.5);
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}
.playlist-editor-close:hover {
    color: white;
}
.playlist-editor-search {
    padding: 12px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.playlist-editor-search input {
    width: 100%;
    padding: 10px 12px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 6px;
    color: white;
    font-size: 14px;
    box-sizing: border-box;
}
.playlist-editor-search input::placeholder {
    color: rgba(255,255,255,0.3);
}
.playlist-editor-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px 0;
}
.playlist-editor-loading {
    padding: 40px 20px;
    text-align: center;
    color: rgba(255,255,255,0.5);
}

/* Video Row */
.playlist-video-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.playlist-video-item.disabled {
    opacity: 0.4;
}
.playlist-video-checkbox {
    width: 24px;
    height: 24px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 4px;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.playlist-video-checkbox.checked {
    background: var(--channel-accent);
    border-color: var(--channel-accent);
}
.playlist-video-checkbox .check-icon {
    color: white;
    font-size: 14px;
}
.playlist-video-thumbnail {
    width: 80px;
    height: 45px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
    background: rgba(255,255,255,0.1);
}
.playlist-video-info {
    flex: 1;
    min-width: 0;
}
.playlist-video-title {
    font-size: 13px;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.playlist-video-timestamps {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
}
.playlist-video-timestamps input {
    width: 60px;
    padding: 4px 6px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 4px;
    color: white;
    font-size: 12px;
    text-align: center;
}
.playlist-video-timestamps input::placeholder {
    color: rgba(255,255,255,0.3);
}
.playlist-video-timestamps span {
    color: rgba(255,255,255,0.3);
    font-size: 12px;
}

/* Video Preview Overlay */
.video-preview-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.95);
    z-index: 10002;
    display: flex;
    align-items: center;
    justify-content: center;
}
.video-preview-container {
    width: 90%;
    max-width: 800px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.video-preview-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: rgba(255,255,255,0.7);
    font-size: 32px;
    cursor: pointer;
    z-index: 10;
}
.video-preview-close:hover {
    color: white;
}
.video-preview-player {
    width: 100%;
    aspect-ratio: 16/9;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
}
.video-preview-player iframe {
    width: 100%;
    height: 100%;
    border: none;
}
.video-preview-controls {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.video-preview-tracker {
    position: relative;
    height: 40px;
    background: rgba(255,255,255,0.1);
    border-radius: 6px;
    cursor: pointer;
    overflow: visible;
}
.video-preview-tracker-bg {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 6px;
    background: rgba(255,255,255,0.2);
    border-radius: 3px;
    transform: translateY(-50%);
}
.video-preview-tracker-progress {
    position: absolute;
    top: 50%;
    left: 0;
    height: 6px;
    background: var(--managed-accent, #c41e3a);
    border-radius: 3px;
    transform: translateY(-50%);
    pointer-events: none;
}
.video-preview-tracker-handle {
    position: absolute;
    top: 50%;
    width: 14px;
    height: 14px;
    background: white;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    cursor: grab;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    z-index: 5;
}
.video-preview-tracker-handle:active {
    cursor: grabbing;
}
/* Timestamp markers */
.video-preview-tracker-start,
.video-preview-tracker-end {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 3px;
    background: #4CAF50;
    cursor: ew-resize;
    z-index: 3;
}
.video-preview-tracker-start::before,
.video-preview-tracker-end::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 8px solid #4CAF50;
}
.video-preview-tracker-start::after,
.video-preview-tracker-end::after {
    content: attr(data-time);
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 10px;
    color: #4CAF50;
    white-space: nowrap;
}
.video-preview-tracker-end {
    background: #f44336;
}
.video-preview-tracker-end::before {
    border-top-color: #f44336;
}
.video-preview-tracker-end::after {
    color: #f44336;
}
/* Highlighted region between markers */
.video-preview-region {
    position: absolute;
    top: 50%;
    height: 6px;
    background: rgba(76, 175, 80, 0.3);
    transform: translateY(-50%);
    pointer-events: none;
    z-index: 2;
}
.video-preview-times {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: rgba(255,255,255,0.5);
    padding: 0 4px;
}
.video-preview-title {
    text-align: center;
    color: white;
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.video-preview-instructions {
    text-align: center;
    color: rgba(255,255,255,0.5);
    font-size: 12px;
    margin-top: 8px;
}
.video-preview-timestamp-btns {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 8px;
}
.video-preview-timestamp-btn {
    padding: 8px 16px;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.3);
    background: transparent;
    color: white;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}
.video-preview-timestamp-btn:hover {
    border-color: var(--managed-accent, white);
    color: var(--managed-accent, white);
}
.video-preview-timestamp-btn.start-btn:hover {
    border-color: #4CAF50;
    color: #4CAF50;
}
.video-preview-timestamp-btn.end-btn:hover {
    border-color: #f44336;
    color: #f44336;
}
.video-preview-timestamp-btn.clear-btn {
    border-color: rgba(255,255,255,0.2);
    color: rgba(255,255,255,0.5);
}
.video-preview-timestamp-btn.save-btn {
    background: var(--managed-accent, #4a9eff);
    border-color: var(--managed-accent, #4a9eff);
    color: white;
}
.video-preview-timestamp-btn.save-btn:hover {
    opacity: 0.9;
}

/* Clickable video title in playlist editor */
.playlist-video-title.clickable {
    cursor: pointer;
    transition: color 0.2s;
}
.playlist-video-title.clickable:hover {
    color: var(--managed-accent, #4a9eff);
    text-decoration: underline;
}

/* Mobile responsive for playlist editor */
@media screen and (max-width: 768px) {
    .playlist-editor-content {
        width: 95%;
        max-height: 85vh;
    }
    .playlist-video-item {
        padding: 8px 15px;
        gap: 8px;
    }
    .playlist-video-thumbnail {
        width: 60px;
        height: 34px;
    }
    .playlist-video-title {
        font-size: 12px;
    }
    .playlist-video-timestamps {
        flex-direction: column;
        gap: 4px;
    }
    .playlist-video-timestamps span {
        display: none;
    }
    .playlist-video-timestamps input {
        width: 50px;
        font-size: 11px;
    }
}

/* Mobile styles for pocket uploader and note editor */
@media screen and (max-width: 768px) {
    .pocket-uploader-container {
        width: 90%;
        max-width: none;
        max-height: 90vh;
        overflow-y: auto;
        padding: 20px;
    }

    .pocket-uploader-header {
        flex-wrap: wrap;
        gap: 8px 15px;
    }

    .pocket-uploader-header-tab {
        font-size: 16px;
    }

    .pocket-uploader-header-divider {
        font-size: 16px;
    }

    .pocket-uploader-close {
        position: static;
        transform: none;
        order: -1;
        margin-left: auto;
        width: 100%;
        text-align: right;
        margin-bottom: -10px;
    }

    .pocket-uploader-types {
        flex-wrap: wrap;
        gap: 10px;
    }

    .pocket-type-btn {
        flex: 1 1 45%;
        padding: 15px 10px;
    }

    .pocket-input {
        font-size: 16px; /* Prevents iOS zoom */
    }

    .note-editor-container {
        width: 90%;
        max-width: calc(100vw - 40px);
        max-height: 90vh;
        overflow-y: auto;
        padding: 20px;
        box-sizing: border-box;
        background: rgba(0, 0, 0, 0.95);
        border-radius: 16px;
        border: 1px solid rgba(255, 255, 255, 0.15);
    }

    .note-editor-container textarea {
        min-height: 150px;
        font-size: 16px; /* Prevents iOS zoom */
        width: 100%;
        box-sizing: border-box;
    }

    .note-editor-upload-options {
        flex-direction: column;
        width: 100%;
    }

    .note-editor-upload-option {
        padding: 15px;
        width: 100%;
        box-sizing: border-box;
    }
}

/* Album Viewer - for viewing albums in pocket */
.pocket-album-viewer {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    position: relative;
    z-index: 1; /* Keep below fixed buttons */
}

.pocket-album-image-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    overflow: hidden;
    padding: 20px;
    box-sizing: border-box;
    position: relative;
}

.pocket-album-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Tap zones for mobile album navigation */
.album-tap-zone {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 40%;
    z-index: 10;
    cursor: pointer;
}

.album-tap-left {
    left: 0;
}

.album-tap-right {
    right: 0;
}

.pocket-album-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.5);
    width: 100%;
}

.pocket-album-nav-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.pocket-album-nav-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
}

.pocket-album-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.pocket-album-counter {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    min-width: 60px;
    text-align: center;
}

/* Mobile: swipe navigation for albums */
@media (max-width: 768px) {
    .pocket-album-nav {
        padding: 10px;
        gap: 15px;
    }

    .pocket-album-nav-btn {
        padding: 8px 16px;
        font-size: 13px;
    }

    .pocket-album-image-container {
        padding: 10px;
    }
}

/* Album edit button in viewer nav */
.pocket-album-edit-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 8px 14px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s ease;
}

.pocket-album-edit-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
}

/* Desktop Album Scroll View - continuous vertical scroll through all images */
.pocket-album-scroll-viewer {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
}

.album-scroll-container {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}

.album-scroll-container::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

.album-scroll-image-wrapper {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: black;
}

.album-scroll-image {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    display: block;
}

.album-scroll-nav {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    padding: 10px 20px;
    border-radius: 8px;
    z-index: 100;
}

/* Album Cover Preview - shown when navigating to album */
.pocket-album-cover {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    cursor: pointer;
    padding: 40px 20px;
    box-sizing: border-box;
}

.pocket-album-cover-image-container {
    position: relative;
    max-width: 300px;
    max-height: 300px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.pocket-album-cover-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.pocket-album-cover-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.pocket-album-cover:hover .pocket-album-cover-overlay {
    opacity: 1;
}

.pocket-album-cover-icon {
    color: white;
    opacity: 0.9;
}

.pocket-album-cover-info {
    margin-top: 24px;
    text-align: center;
}

.pocket-album-cover-name {
    font-size: 20px;
    font-weight: 500;
    color: white;
    margin-bottom: 8px;
}

.pocket-album-cover-count {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
}

@media screen and (max-width: 768px) {
    .pocket-album-cover-image-container {
        max-width: 200px;
        max-height: 200px;
    }

    .pocket-album-cover-name {
        font-size: 18px;
    }

    .pocket-album-cover-overlay {
        opacity: 1;
        background: rgba(0, 0, 0, 0.2);
    }
}

/* Album Grid View - shows thumbnails before enhanced view */
.pocket-album-grid {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.pocket-album-grid-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.pocket-album-grid-title {
    font-size: 18px;
    font-weight: 500;
    color: white;
}

.pocket-album-grid-count {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
}

.pocket-album-grid-container {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
    padding: 20px;
    overflow-y: auto;
    align-content: start;
}

.pocket-album-grid-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: visible;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.pocket-album-grid-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.pocket-album-grid-item:hover {
    transform: scale(1.05);
}

/* Delete button in album grid - matches pocket grid delete style */
.pocket-album-grid-delete {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(200, 60, 60, 0.9);
    border: 2px solid white;
    color: white;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    z-index: 10;
}

.pocket-album-grid-item:hover .pocket-album-grid-delete {
    opacity: 1;
}

.pocket-album-grid-delete:hover {
    background: rgba(220, 40, 40, 1);
    transform: scale(1.1);
}

/* Add tile for adding more images to album */
.pocket-album-add-tile {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border: 2px dashed rgba(255, 255, 255, 0.3);
    border-radius: 8px;
}

.pocket-album-add-tile:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.5);
}

.pocket-album-add-icon {
    font-size: 36px;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 300;
}

.pocket-album-add-tile:hover .pocket-album-add-icon {
    color: rgba(255, 255, 255, 0.8);
}

/* Back to grid button in enhanced album view */
.pocket-album-back-btn {
    position: absolute;
    top: 15px;
    left: 15px;
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s ease;
    z-index: 5;
}

.pocket-album-back-btn:hover {
    background: rgba(0, 0, 0, 0.8);
    border-color: rgba(255, 255, 255, 0.5);
}

/* Mobile adjustments for album grid */
@media (max-width: 768px) {
    .pocket-album-grid-container {
        grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
        gap: 8px;
        padding: 12px;
    }

    .pocket-album-grid-header {
        padding: 12px 15px;
    }

    .pocket-album-grid-title {
        font-size: 16px;
    }

    .pocket-album-grid-delete {
        opacity: 1; /* Always show on mobile */
    }

    .pocket-album-back-btn {
        top: 10px;
        left: 10px;
        padding: 6px 10px;
        font-size: 12px;
    }
}

/* Album Editor Overlay */
.album-editor-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 20;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
}

.album-editor-overlay.active {
    display: flex;
}

.album-editor-container {
    background: #1a1a1a;
    border-radius: 12px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.album-editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.album-editor-header h2 {
    margin: 0;
    font-size: 18px;
    color: white;
    font-weight: 500;
}

.album-editor-close {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.album-editor-close:hover {
    color: white;
}

.album-editor-hint {
    margin: 0;
    padding: 12px 20px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
}

.album-editor-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    padding: 0 20px 20px;
    overflow-y: auto;
    flex: 1;
}

.album-editor-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    cursor: grab;
    border: 2px solid transparent;
    transition: border-color 0.2s, transform 0.2s, opacity 0.2s;
}

.album-editor-item:active {
    cursor: grabbing;
}

.album-editor-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.album-editor-item-num {
    position: absolute;
    bottom: 6px;
    right: 6px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
}

.album-editor-item.dragging {
    opacity: 0.3;
    transform: scale(0.95);
}

.album-editor-item.drag-over {
    border-color: #4a9eff;
    transform: scale(1.05);
}

.album-editor-ghost {
    width: 100px;
    height: 100px;
    border-radius: 8px;
    overflow: hidden;
}

.album-editor-ghost img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.album-editor-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.album-editor-cancel {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.7);
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.album-editor-cancel:hover {
    border-color: rgba(255, 255, 255, 0.5);
    color: white;
}

.album-editor-save {
    background: #4a9eff;
    border: none;
    color: white;
    padding: 10px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.album-editor-save:hover {
    background: #3a8eef;
}

.album-editor-save:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Responsive album editor */
@media (max-width: 768px) {
    .album-editor-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .album-editor-container {
        max-height: 80vh;
    }
}

@media (max-width: 480px) {
    .album-editor-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Upload button */
.pocket-upload-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 14px 20px;
    background: transparent;
    border: 1px dashed rgba(255, 255, 255, 0.4);
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.pocket-upload-btn:hover {
    border-color: white;
    color: white;
    background: rgba(255, 255, 255, 0.05);
}

.pocket-upload-btn svg {
    stroke: currentColor;
}

.pocket-upload-btn-small {
    width: auto;
    padding: 10px 16px;
    font-size: 13px;
}

/* File uploaded indicator */
.pocket-file-uploaded {
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
}

.pocket-file-name {
    word-break: break-all;
}

/* Thumbnail section */
.pocket-thumbnail-section {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.pocket-thumbnail-section label {
    display: block;
    color: rgba(255, 255, 255, 0.5);
    font-size: 13px;
    margin-bottom: 10px;
}

/* =========================
   SCREENING OVERLAY
   Synchronized movie screenings
   ========================= */

.screening-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9998; /* Above shop overlay on mobile */
    background: black;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* When on shop tab with screening active, shop goes on top */
body.safari-entry-mode .screening-overlay:not(.hidden) {
    z-index: 5; /* Below shop */
}
body.mobile-tv-tab-active .screening-overlay:not(.hidden) {
    z-index: 9998; /* Above everything on stage tab */
}

.screening-overlay.hidden {
    display: none;
}

/* Countdown state */
.screening-countdown {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
}

.screening-countdown.hidden {
    display: none;
}

/* Curtain graphic - gradient panels on left and right */
.screening-curtains {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 0;
}

/* Left curtain - gradient from accent color to transparent */
.screening-curtains::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 25%;
    background: linear-gradient(
        to right,
        var(--channel-accent, #661111) 0%,
        var(--channel-accent, #661111) 20%,
        rgba(0, 0, 0, 0.8) 60%,
        transparent 100%
    );
}

/* Right curtain - gradient from accent color to transparent */
.screening-curtains::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 25%;
    background: linear-gradient(
        to left,
        var(--channel-accent, #661111) 0%,
        var(--channel-accent, #661111) 20%,
        rgba(0, 0, 0, 0.8) 60%,
        transparent 100%
    );
}

/* Hide the fold divs - using pseudo-elements instead */
.curtain, .curtain-fold {
    display: none;
}

/* Countdown content on top of curtains */
.screening-countdown-content {
    position: relative;
    z-index: 1;
}

/* Voice chat label */
.voice-chat-label {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 8px;
    text-transform: lowercase;
}

.screening-countdown-title {
    font-size: 28px;
    font-weight: 300;
    margin-bottom: 10px;
    color: rgba(255, 255, 255, 0.9);
}

.screening-countdown-channel {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.4);
    margin-bottom: 50px;
}

.screening-countdown-timer {
    font-size: 80px;
    font-weight: 200;
    font-variant-numeric: tabular-nums;
    letter-spacing: 4px;
    color: white;
}

.screening-countdown-label {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.4);
    margin-top: 20px;
}

.screening-waiting-for {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 30px;
}

.screening-waiting-for:empty {
    display: none;
}

/* Voice chat during countdown */
.screening-voice-chat {
    position: fixed;
    bottom: 25%;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    z-index: 999998;
    pointer-events: auto;
}

/* On mobile, move voice chat even higher */
@media (max-width: 768px) {
    .screening-voice-chat {
        bottom: 35%;
    }
}

/* Voice chat during live playback (centered on screen) */
.screening-voice-chat-live {
    position: fixed;
    bottom: 50%;
    left: 50%;
    transform: translate(-50%, 50%);
    z-index: 100000;
    background: rgba(0, 0, 0, 0.8);
    padding: 20px 30px;
    border-radius: 12px;
}

.voice-chat-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    position: relative;
    color: white;
    pointer-events: auto !important;
    z-index: 999999;
    -webkit-tap-highlight-color: rgba(255, 255, 255, 0.3);
    touch-action: manipulation;
}

.voice-chat-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

.voice-chat-btn.muted {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    opacity: 0.6;
}

.voice-chat-btn.muted::after {
    content: '';
    position: absolute;
    width: 2px;
    height: 30px;
    background: rgba(255, 100, 100, 0.9);
    transform: rotate(45deg);
    border-radius: 2px;
}

.voice-chat-btn:not(.muted) {
    background: rgba(100, 200, 100, 0.3);
    border-color: rgba(100, 200, 100, 0.5);
    animation: pulse-mic 2s infinite;
}

@keyframes pulse-mic {
    0%, 100% { box-shadow: 0 0 0 0 rgba(100, 200, 100, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(100, 200, 100, 0); }
}

.voice-icon {
    font-size: 20px;
    position: relative;
}

.voice-chat-participants {
    display: flex;
    gap: 8px;
}

.voice-participant {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    transition: all 0.15s ease;
}

.voice-participant.speaking {
    background: rgba(100, 255, 150, 0.8);
    box-shadow: 0 0 8px rgba(100, 255, 150, 0.5);
}

.voice-chat-joining {
    font-family: 'Times New Roman', Times, serif;
    font-style: italic;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
}

/* Voice viewer count - upper left during voice chat period */
.voice-viewer-count {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 9999;
    font-family: 'Times New Roman', Times, serif;
    font-style: italic;
    font-size: 16px;
    color: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    gap: 8px;
}

.voice-viewer-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(100, 255, 150, 0.8);
    box-shadow: 0 0 6px rgba(100, 255, 150, 0.5);
    animation: voice-pulse 2s ease-in-out infinite;
}

@keyframes voice-pulse {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; }
}

/* Live playback state */
.screening-live {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.screening-live.hidden {
    display: none;
}

.screening-video {
    max-width: 100%;
    max-height: 100%;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Subtitle styling for screening video */
.screening-video::cue {
    background: rgba(0, 0, 0, 0.75);
    color: white;
    font-size: 1.1em;
    line-height: 1.4;
    padding: 4px 8px;
}

/* Mobile: shrink video to leave room for nav at bottom, subtitles stay within video */
@media screen and (max-width: 768px) {
    .screening-video {
        height: calc(100% - 60px) !important;
        max-height: calc(100% - 60px) !important;
    }
    .screening-video::cue {
        font-size: 0.9em;
    }
}

/* Ended state */
.screening-ended {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.screening-ended.hidden {
    display: none;
}

.screening-ended-title {
    font-size: 24px;
    font-weight: 300;
    margin-bottom: 10px;
    color: rgba(255, 255, 255, 0.6);
}

.screening-ended-message {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.4);
}

/* Viewer count - positioned above age daily text */
.screening-viewer-count {
    position: fixed;
    bottom: 145px;
    left: 10px;
    display: none; /* Hidden by default, shown when screening active */
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
    z-index: 100001; /* Above screening overlay content */
    transition: opacity 0.3s ease;
    background: rgba(0, 0, 0, 0.6);
    padding: 6px 10px;
    border-radius: 6px;
}

/* Show viewer count when screening overlay is active (not hidden) */
.screening-overlay:not(.hidden) .screening-viewer-count {
    display: flex;
}

.viewer-dot {
    width: 8px;
    height: 8px;
    background: #e74c3c;
    border-radius: 50%;
    animation: viewer-pulse 1.5s infinite;
}

@keyframes viewer-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Fullscreen button - bottom right, minimal */
.screening-fullscreen-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: transparent;
    border: none;
    color: white;
    padding: 8px;
    cursor: pointer;
    z-index: 99999;
    transition: opacity 0.2s ease;
    opacity: 0.7;
    pointer-events: auto !important;
}

.screening-fullscreen-btn:hover {
    opacity: 1;
}

/* Hide fullscreen button on mobile portrait - only show in landscape */
/* This avoids iOS Safari positioning bug when exiting fullscreen in portrait */
@media screen and (max-width: 1024px) and (orientation: portrait) {
    .screening-fullscreen-btn {
        display: none !important;
    }
}

/* Show fullscreen button on mobile landscape */
@media screen and (max-width: 1024px) and (orientation: landscape) {
    .screening-fullscreen-btn {
        display: block !important;
        bottom: 10px;
        right: 10px;
    }
}

.screening-fullscreen-btn svg {
    display: block;
    width: 28px;
    height: 28px;
}

/* Now Playing indicator - upper left */
.screening-now-playing {
    position: fixed;
    top: 20px;
    left: 20px;
    color: white;
    font-size: 14px;
    font-family: Arial, sans-serif;
    z-index: 99999;
    opacity: 0 !important;
    transition: opacity 0.3s ease;
    pointer-events: none;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}
body.screening-active:hover .screening-now-playing {
    opacity: 1 !important;
}

.screening-now-playing span {
    font-style: italic;
}

.screening-now-playing-stage {
    font-size: 12px;
    margin-top: 4px;
    opacity: 0.7;
}

/* When in shop mode during screening, move Now Playing to bottom left */
body.safari-entry-mode.screening-active .screening-now-playing {
    top: auto !important;
    bottom: 30px !important;
    left: 20px !important;
}

/* Hide UI when fullscreen */
.screening-overlay:fullscreen .screening-fullscreen-btn,
.screening-overlay:-webkit-full-screen .screening-fullscreen-btn {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.screening-overlay:fullscreen:hover .screening-fullscreen-btn,
.screening-overlay:-webkit-full-screen:hover .screening-fullscreen-btn {
    opacity: 1;
}

.screening-overlay:fullscreen .screening-viewer-count,
.screening-overlay:-webkit-full-screen .screening-viewer-count {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.screening-overlay:fullscreen:hover .screening-viewer-count,
.screening-overlay:-webkit-full-screen:hover .screening-viewer-count {
    opacity: 1;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .screening-countdown-title {
        font-size: 22px;
        padding: 0 20px;
    }

    .screening-countdown-timer {
        font-size: 48px;
    }

    .screening-fullscreen-btn {
        /* Keep visible on mobile - video element is recreated on iOS fullscreen exit to fix positioning */
        bottom: 15px;
        right: 15px;
    }

    .screening-viewer-count {
        bottom: 80px;
        left: 10px;
    }
}

/* Mobile Screening Controls - matches mobile-nav-buttons styling */
.mobile-screening-controls {
    display: none; /* Hidden by default */
    position: fixed;
    bottom: 25px;
    left: 15px;
    gap: 10px;
    align-items: center;
    z-index: 100010;
    pointer-events: none;
}

.mobile-screening-btn {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background: transparent;
    color: var(--channel-accent, #c41e3a);
    border: 1px solid var(--channel-accent, #c41e3a);
    padding: 6px 14px;
    border-radius: 3px;
    font-size: 13px;
    font-family: Arial, sans-serif;
    cursor: pointer;
    text-transform: lowercase;
    pointer-events: auto;
    opacity: 0.9;
}

.mobile-screening-btn:active {
    opacity: 1;
    background: rgba(255, 255, 255, 0.1);
}

/* Show mobile screening controls during active screening */
body.screening-active .mobile-screening-controls {
    display: flex !important;
}

/* On portrait, hide screening controls (use mobile-nav-buttons instead) */
@media screen and (max-width: 1024px) and (orientation: portrait) {
    body.screening-active .mobile-screening-controls {
        display: none !important;
    }
}

/* Show mobile nav buttons (mute, index, home) during screening in portrait only */
@media screen and (max-width: 1024px) and (orientation: portrait) {
    body.screening-active .mobile-nav-buttons {
        display: flex !important;
        z-index: 100011 !important;
    }

    /* Keep nav buttons at bottom when subtitles are active */
    body.subtitles-active.screening-active .mobile-nav-buttons {
        bottom: 25px !important;
    }

    /* During screening on mobile portrait: keep tabs and Age Daily visible above screening */
    body.screening-active .safari-channel-tabs {
        z-index: 99999 !important;
    }
    body.screening-active #ageDaily {
        z-index: 99999 !important;
    }
    body.screening-active:not(.safari-entry-mode) .mobile-nav-buttons {
        z-index: 99999 !important;
    }
    body.safari-entry-mode .mobile-nav-buttons {
        display: none !important;
    }
    body.screening-active .channel-index-overlay {
        z-index: 99999 !important;
    }
}

/* Hide mobile nav buttons in landscape during screenings */
@media screen and (max-width: 1024px) and (orientation: landscape) {
    body.screening-active .mobile-nav-buttons {
        display: none !important;
    }
}

/* Hide UI elements when screening overlay is visible (landscape/desktop only) */
@media screen and (min-width: 1025px), screen and (orientation: landscape) {
    body:has(.screening-overlay:not(.hidden)) .channel-info-display,
    body:has(.screening-overlay:not(.hidden)) .channel-avatar-container,
    body:has(.screening-overlay:not(.hidden)) .header-info,
    body:has(.screening-overlay:not(.hidden)) .channel-video-title,
    body:has(.screening-overlay:not(.hidden)) .landscape-channel-name,
    body:has(.screening-overlay:not(.hidden)) .typo-controls,
    body:has(.screening-overlay:not(.hidden)) #ageDaily,
    body:has(.screening-overlay:not(.hidden)) #homeIndexButtons,
    body:has(.screening-overlay:not(.hidden)) #ownerButtons,
    body:has(.screening-overlay:not(.hidden)) .channel-nav-arrows,
    body:has(.screening-overlay:not(.hidden)) .desktop-logout {
        opacity: 0 !important;
        pointer-events: none !important;
        transition: opacity 0.3s ease;
    }

    /* Hide viewer counter on desktop during screening */
    body:has(.screening-overlay:not(.hidden)) .screening-viewer-count,
    body.screening-active .screening-viewer-count {
        display: none !important;
    }

    /* Show channel avatar and info on hover during screening */
    body:has(.screening-overlay:not(.hidden)):hover .channel-avatar-container,
    body:has(.screening-overlay:not(.hidden)):hover .channel-info-display,
    body:has(.screening-overlay:not(.hidden)):hover .typo-controls,
    body:has(.screening-overlay:not(.hidden)):hover #ageDaily,
    body:has(.screening-overlay:not(.hidden)):hover #homeIndexButtons,
    body:has(.screening-overlay:not(.hidden)):hover #ownerButtons,
    body:has(.screening-overlay:not(.hidden)):hover .channel-nav-arrows,
    body:has(.screening-overlay:not(.hidden)):hover .desktop-logout {
        opacity: 1 !important;
        pointer-events: auto !important;
        z-index: 999999 !important;
    }

    body.screening-active:hover .channel-avatar-container,
    body.screening-active:hover .channel-info-display,
    body.screening-active:hover .typo-controls,
    body.screening-active:hover #ageDaily,
    body.screening-active:hover #homeIndexButtons,
    body.screening-active:hover #ownerButtons,
    body.screening-active:hover .channel-nav-arrows,
    body.screening-active:hover .desktop-logout,
    body.screening-active:hover .safari-channel-tabs {
        display: flex !important;
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
        z-index: 999999 !important;
    }

    body.screening-active .channel-index-overlay.visible {
        z-index: 999999 !important;
    }

    /* Move controls to top-left when subtitles are active during screening */
    body.subtitles-active.screening-active .typo-controls,
    body.subtitles-active:has(.screening-overlay:not(.hidden)) .typo-controls {
        bottom: auto !important;
        top: 20px !important;
        left: 20px !important;
    }

    /* Show big centered channel name on hover during screening - like channel-preview style */
    body:has(.screening-overlay:not(.hidden)):hover .channel-preview-info,
    body.screening-active:hover .channel-preview-info {
        display: block !important;
        opacity: 1 !important;
        pointer-events: none !important;
        position: fixed !important;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
        z-index: 100010 !important;
        text-align: center !important;
    }

    body:has(.screening-overlay:not(.hidden)):hover .channel-preview-info h1,
    body.screening-active:hover .channel-preview-info h1 {
        color: var(--channel-accent) !important;
        font-size: 32px !important;
        text-decoration: underline !important;
        margin: 0 !important;
    }

    /* Hide the bio part during screening hover */
    body:has(.screening-overlay:not(.hidden)):hover .channel-preview-info .bio,
    body.screening-active:hover .channel-preview-info .bio {
        display: none !important;
    }

    /* Keep small landscape name hidden during screening */
    body:has(.screening-overlay:not(.hidden)) .landscape-channel-name,
    body.screening-active .landscape-channel-name {
        display: none !important;
    }

    /* Grey out pause/skip buttons during screening, but keep mute visible */
    body:has(.screening-overlay:not(.hidden)) #typoPauseBtn,
    body:has(.screening-overlay:not(.hidden)) #typoSkipBtn,
    body.screening-active #typoPauseBtn,
    body.screening-active #typoSkipBtn {
        opacity: 0.3 !important;
        pointer-events: none !important;
    }

    /* Hide name/location from channel info during screening */
    body:has(.screening-overlay:not(.hidden)) .channel-info-name,
    body:has(.screening-overlay:not(.hidden)) .channel-info-location,
    body.screening-active .channel-info-name,
    body.screening-active .channel-info-location {
        display: none !important;
    }

    /* Now Playing indicator — below tabs on mobile */
    .screening-now-playing {
        top: 55px !important;
        left: 15px !important;
        font-size: 12px !important;
        opacity: 0 !important;
        transition: opacity 0.3s ease;
    }
    /* Show on tap (via JS inline opacity) */
    .screening-now-playing[style*="opacity: 1"] {
        opacity: 1 !important;
    }

    /* Position channel info links near fullscreen button during screening */
    body:has(.screening-overlay:not(.hidden)):hover .channel-info-display,
    body.screening-active:hover .channel-info-display {
        position: fixed !important;
        bottom: 20px !important;
        right: 70px !important;
        left: auto !important;
        top: auto !important;
        background: transparent !important;
        padding: 0 !important;
    }

    body:has(.screening-overlay:not(.hidden)):hover .channel-info-links,
    body.screening-active:hover .channel-info-links {
        display: flex !important;
        gap: 12px !important;
    }

    /* Hide Caveh-specific links during screening */
    body:has(.screening-overlay:not(.hidden)) .caveh-links,
    body.screening-active .caveh-links {
        display: none !important;
    }

    /* Ensure close buttons are visible during screening - position upper right */
    body:has(.screening-overlay:not(.hidden)) .notes-close-btn,
    body:has(.screening-overlay:not(.hidden)) .pocket-close-btn,
    body:has(.screening-overlay:not(.hidden)) .pocket-close-x,
    body.screening-active .notes-close-btn,
    body.screening-active .pocket-close-btn,
    body.screening-active .pocket-close-x {
        display: block !important;
        opacity: 1 !important;
        z-index: 100010 !important;
        position: fixed !important;
        top: 20px !important;
        right: 20px !important;
        left: auto !important;
        background: transparent !important;
        border: none !important;
        color: rgba(255, 255, 255, 0.6) !important;
        font-size: 32px !important;
        cursor: pointer !important;
        padding: 10px !important;
        line-height: 1 !important;
    }

    body:has(.screening-overlay:not(.hidden)) .pocket-close-x:hover,
    body.screening-active .pocket-close-x:hover {
        color: white !important;
    }

    /* Ensure pocket viewing overlay is above screening */
    body:has(.screening-overlay:not(.hidden)) .pocket-viewing-overlay.active,
    body.screening-active .pocket-viewing-overlay.active {
        z-index: 100005 !important;
    }

    /* Ensure notes overlay is above screening */
    body:has(.screening-overlay:not(.hidden)) .notes-viewing-overlay,
    body.screening-active .notes-viewing-overlay {
        z-index: 100005 !important;
    }

    /* Ensure inventory overlay (pocket grid) is above screening */
    body:has(.screening-overlay:not(.hidden)) .inventory-overlay,
    body.screening-active .inventory-overlay {
        z-index: 100005 !important;
    }

    /* Ensure channel tabs are visible and above screening when pocket/canvas is open */
    body:has(.screening-overlay:not(.hidden)).safari-channel-pocket-mode .safari-channel-tabs,
    body:has(.screening-overlay:not(.hidden)):has(.notes-viewing-overlay.active) .safari-channel-tabs,
    body.screening-active.safari-channel-pocket-mode .safari-channel-tabs,
    body.screening-active:has(.notes-viewing-overlay.active) .safari-channel-tabs {
        display: flex !important;
        z-index: 100015 !important;
        opacity: 1 !important;
        pointer-events: auto !important;
    }

    /* Ensure canvas tabs (within canvas view) are visible during screening - only when canvas is open */
    body:has(.screening-overlay:not(.hidden)):has(.notes-viewing-overlay.active) .canvas-tabs-container,
    body.screening-active:has(.notes-viewing-overlay.active) .canvas-tabs-container {
        display: flex !important;
        opacity: 1 !important;
        pointer-events: auto !important;
        z-index: 100015 !important;
    }

    /* Make screening overlay non-interactive when pocket/canvas is open (so close buttons work) */
    body.safari-channel-pocket-mode .screening-overlay,
    body:has(.notes-viewing-overlay.active) .screening-overlay,
    body:has(.inventory-overlay.visible) .screening-overlay {
        pointer-events: none !important;
    }
    /* But keep the video itself interactive for unmuting */
    body.safari-channel-pocket-mode .screening-overlay .screening-video,
    body:has(.notes-viewing-overlay.active) .screening-overlay .screening-video,
    body:has(.inventory-overlay.visible) .screening-overlay .screening-video {
        pointer-events: auto !important;
    }

    /* Grey out video items in pocket during screening */
    body:has(.screening-overlay:not(.hidden)) .inventory-item[data-type="video"],
    body.screening-active .inventory-item[data-type="video"] {
        opacity: 0.3 !important;
        pointer-events: none !important;
    }

    /* Hide skip buttons for ALL users during screening (desktop/landscape) - pause just gets greyed out */
    body:has(.screening-overlay:not(.hidden)) #typoPrevBtn,
    body:has(.screening-overlay:not(.hidden)) #typoNextBtn,
    body:has(.screening-overlay:not(.hidden)) .mobile-prev-btn,
    body:has(.screening-overlay:not(.hidden)) .mobile-next-btn,
    body:has(.screening-overlay:not(.hidden)) .mobile-pause-btn {
        display: none !important;
    }
}

/* Grey out skip and pause buttons for ALL users during screening (all screen sizes) */
body:has(.screening-overlay:not(.hidden)) #typoPrevBtn,
body:has(.screening-overlay:not(.hidden)) #typoNextBtn,
body:has(.screening-overlay:not(.hidden)) #typoPauseBtn,
body:has(.screening-overlay:not(.hidden)) #typoSkipBtn,
body:has(.screening-overlay:not(.hidden)) .mobile-prev-btn,
body:has(.screening-overlay:not(.hidden)) .mobile-next-btn,
body:has(.screening-overlay:not(.hidden)) .mobile-pause-btn,
body.screening-active #typoPrevBtn,
body.screening-active #typoNextBtn,
body.screening-active #typoPauseBtn,
body.screening-active #typoSkipBtn,
body.screening-active .mobile-prev-btn,
body.screening-active .mobile-next-btn,
body.screening-active .mobile-pause-btn {
    opacity: 0.3 !important;
    pointer-events: none !important;
}

/* Hide Caveh-specific links during screening (all screen sizes) */
body:has(.screening-overlay:not(.hidden)) .caveh-links,
body:has(.screening-overlay:not(.hidden)) #channelInfoTV,
body:has(.screening-overlay:not(.hidden)) #channelInfoFilm,
body.screening-active .caveh-links,
body.screening-active #channelInfoTV,
body.screening-active #channelInfoFilm {
    display: none !important;
}

/* Fullscreen button - desktop: hidden by default, shows on hover */
/* Mobile: always visible since no hover */
.screening-fullscreen-btn {
    opacity: 0 !important;
    transition: opacity 0.3s ease;
}

body:has(.screening-overlay:not(.hidden)):hover .screening-fullscreen-btn,
.screening-overlay:not(.hidden):hover ~ .screening-fullscreen-btn {
    opacity: 0.7 !important;
}

.screening-fullscreen-btn:hover {
    opacity: 1 !important;
}

/* Mobile: always show screening fullscreen button (no hover on touch) */
@media screen and (max-width: 1024px) {
    body.screening-active .screening-fullscreen-btn {
        opacity: 0.8 !important;
    }
}

/* Hide upper-left fullscreen button during screening on desktop */
body.screening-active .fullscreen-icon-btn,
body:has(.screening-overlay:not(.hidden)) .fullscreen-icon-btn {
    display: none !important;
}

/* Screening owner controls (upper right) */
.screening-owner-controls {
    display: none;
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.7);
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 100002;
    backdrop-filter: blur(10px);
}

.screening-owner-cancel {
    color: rgba(255, 100, 100, 0.9);
    cursor: pointer;
}

.screening-owner-cancel:hover {
    color: rgba(255, 100, 100, 1);
    text-decoration: underline;
}

/* Show for owners during screening - both desktop and mobile */
body.owner-mode:has(.screening-overlay:not(.hidden)) .screening-owner-controls,
body.owner-mode.screening-active .screening-owner-controls {
    display: block;
}

/* Channel info screening display */
.channel-screening-info {
    font-size: 13px;
    color: white;
    font-weight: bold;
    margin-top: 8px;
    line-height: 1.4;
}

/* Fixed screening countdown - upper left corner */
.screening-countdown-fixed {
    position: fixed;
    top: 20px;
    left: 20px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 12px 18px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    font-variant-numeric: tabular-nums;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.screening-countdown-fixed.waiting {
    color: rgba(241, 196, 15, 0.9);
}

/* Screening action links (edit | cancel) */
.channel-screening-actions {
    font-size: 12px;
    margin-top: 4px;
    pointer-events: auto;
}

.channel-screening-edit {
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
}

.channel-screening-edit:hover {
    color: white;
    text-decoration: underline;
}

.channel-screening-divider {
    color: rgba(255, 255, 255, 0.4);
    margin: 0 6px;
}

.channel-screening-cancel {
    color: rgba(255, 100, 100, 0.8);
    cursor: pointer;
}

.channel-screening-cancel:hover {
    color: rgba(255, 100, 100, 1);
    text-decoration: underline;
}

/* Edit Screening Modal */
.edit-screening-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.edit-screening-content {
    background: #1a1a1a;
    padding: 24px;
    border-radius: 12px;
    min-width: 280px;
}

.edit-screening-content h3 {
    margin: 0 0 20px 0;
    color: white;
    font-size: 18px;
}

.edit-screening-field {
    margin-bottom: 16px;
}

.edit-screening-field label {
    display: block;
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    margin-bottom: 6px;
}

.edit-screening-field input {
    width: 100%;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 14px;
    box-sizing: border-box;
}

.edit-screening-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.edit-screening-buttons button {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    background: white;
    color: black;
}

.edit-screening-buttons button.cancel-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

/* ============================================
   THUMBPRINT LOGIN
   ============================================ */

/* Thumbprint Login Icon - DISABLED (using text login button instead) */
.thumbprint-login {
    display: none !important;
}

.thumbprint-icon {
    width: 42px;
    height: 42px;
    fill: var(--channel-accent);
    opacity: 0.6;
    transition: opacity 0.3s, transform 0.3s;
}

.thumbprint-login:active .thumbprint-icon,
.thumbprint-login.pressing .thumbprint-icon {
    opacity: 1;
    transform: scale(1.1);
}

/* Scanning animation ring */
.thumbprint-scanning {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 54px;
    height: 54px;
    border: 2px solid transparent;
    border-radius: 50%;
    pointer-events: none;
}

.thumbprint-scanning.active {
    border-color: var(--channel-accent);
    animation: thumbprint-scan 1.5s ease-in-out forwards;
}

@keyframes thumbprint-scan {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0;
        border-color: var(--channel-accent);
    }
    20% {
        opacity: 1;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.3);
        opacity: 0.8;
    }
    100% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0;
        border-color: rgba(0, 255, 0, 0.8);
    }
}

.thumbprint-scanning.success {
    animation: thumbprint-success 0.5s ease-out forwards;
}

@keyframes thumbprint-success {
    0% {
        transform: translate(-50%, -50%) scale(1);
        border-color: rgba(0, 255, 0, 0.8);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(1.5);
        border-color: rgba(0, 255, 0, 0);
        opacity: 0;
    }
}

/* Note: thumbprint is always visible on mobile, shows sign-out when logged in */

/* Login Overlay */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
}

.login-overlay.active {
    display: flex;
}

.login-container {
    width: 90%;
    max-width: 400px;
    padding: 30px;
}

.login-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.login-header h2 {
    color: red;
    font-size: 18px;
    font-weight: normal;
    margin: 0;
}

.login-close {
    background: none;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    opacity: 0.7;
    line-height: 1;
}

.login-close:hover {
    opacity: 1;
}

.login-field {
    margin-bottom: 20px;
}

.login-field label {
    display: block;
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
    margin-bottom: 8px;
}

.login-field input {
    width: 100%;
    padding: 12px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    font-size: 16px;
    border-radius: 4px;
    box-sizing: border-box;
}

.login-field input:focus {
    outline: none;
    border-color: red;
}

.login-error {
    color: #ff6b6b;
    font-size: 13px;
    margin-bottom: 15px;
    display: none;
}

.login-error.visible {
    display: block;
}

.login-success {
    color: #4ade80;
    font-size: 13px;
    margin-bottom: 15px;
    display: none;
}

.login-success.visible {
    display: block;
}

.login-actions {
    display: flex;
    gap: 12px;
    margin-top: 25px;
}

.login-invitation-note {
    font-family: Georgia, 'Times New Roman', Times, serif;
    font-style: italic;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
    text-align: center;
    margin-top: 20px;
    margin-bottom: 0;
}

.login-cancel {
    flex: 1;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.7);
    padding: 12px;
    font-size: 14px;
    cursor: pointer;
    border-radius: 4px;
}

.login-cancel:hover {
    border-color: rgba(255, 255, 255, 0.5);
    color: white;
}

.login-submit {
    flex: 1;
    background: red;
    border: none;
    color: white;
    padding: 12px;
    font-size: 14px;
    cursor: pointer;
    border-radius: 4px;
}

.login-submit:hover {
    background: #cc0000;
}

.login-submit:disabled {
    background: rgba(255, 0, 0, 0.4);
    cursor: not-allowed;
}

/* Sign-out overlay - uses owner's accent color */
#signOutOverlay .login-header h2 {
    color: var(--owner-accent, red);
}

#signOutOverlay .login-submit {
    background: var(--owner-accent, red);
}

#signOutOverlay .login-submit:hover {
    filter: brightness(0.85);
}

.signout-message {
    text-align: center;
    padding: 20px 0;
}

.signout-message p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    margin: 10px 0;
}

.signout-message span {
    color: var(--owner-accent, red);
    font-weight: 500;
}

/* Hide thumbprint when overlays are open */
body:has(.notes-viewing-overlay.active) .thumbprint-login,
body:has(.pocket-viewing-overlay.active) .thumbprint-login,
body:has(.login-overlay.active) .thumbprint-login {
    display: none !important;
}

/* ============================================================================
   ONBOARDING MESSAGES - New user welcome messages
   ============================================================================ */

.onboarding-message {
    position: fixed;
    z-index: 999999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.8s ease;
}

.onboarding-message.visible {
    opacity: 1;
}

/* Desktop: Times italic, large like John Tottenham header (120px) */
@media screen and (min-width: 1025px) {
    .onboarding-welcome {
        top: 20px;
        left: 20px;
        font-family: 'Times New Roman', Times, Georgia, serif;
        font-style: italic;
        font-size: 120px;
        line-height: 0.9;
        color: white;
        text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    }

    .onboarding-notebook,
    .onboarding-pocket {
        font-family: 'Times New Roman', Times, Georgia, serif;
        font-style: italic;
        font-size: 60px;
        line-height: 1.1;
        color: white;
        text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    }

    .onboarding-notebook {
        top: 80px;
        left: 50%;
        transform: translateX(-50%);
        text-align: center;
        max-width: 800px;
    }

    .onboarding-pocket {
        top: 80px;
        left: 50%;
        transform: translateX(-50%);
        text-align: center;
        max-width: 900px;
    }
}

/* Mobile: Times italic, sized like mobile shop header (40px) */
@media screen and (max-width: 1024px) {
    .onboarding-welcome {
        top: 15px;
        left: 15px;
        right: 15px;
        font-family: 'Times New Roman', Times, Georgia, serif;
        font-style: italic;
        font-size: 40px;
        line-height: 0.9;
        color: white;
        text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    }

    .onboarding-notebook,
    .onboarding-pocket {
        font-family: 'Times New Roman', Times, Georgia, serif;
        font-style: italic;
        font-size: 24px;
        line-height: 1.1;
        color: white;
        text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
        text-align: center;
        padding: 0 20px;
    }

    .onboarding-notebook {
        top: 70px;
        left: 0;
        right: 0;
    }

    .onboarding-pocket {
        top: 70px;
        left: 0;
        right: 0;
    }
}

/* ============================================================================
   PROMO MODAL - Screening promotional images
   ============================================================================ */

.promo-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 100000;
    overflow-y: auto;
    padding: 20px;
}

.promo-modal.active {
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.promo-modal-content {
    background: #1a1a1a;
    border-radius: 12px;
    padding: 24px;
    max-width: 800px;
    width: 100%;
    margin: 40px auto;
}

.promo-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-family: 'Times New Roman', Times, serif;
    font-style: italic;
    font-size: 24px;
    color: white;
}

.promo-modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 32px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    opacity: 0.7;
}

.promo-modal-close:hover {
    opacity: 1;
}

.promo-modal-subtitle {
    font-family: Arial, sans-serif;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 24px;
}

.promo-images {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    justify-content: center;
}

.promo-image-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.promo-image-container canvas {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

#promoSquare, #promoSquareFlat {
    width: 200px;
    height: 200px;
}

#promoStory, #promoStoryFlat {
    width: 130px;
    height: 230px;
}

.promo-download-btn {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    font-family: Arial, sans-serif;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.promo-download-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

@media screen and (max-width: 600px) {
    .promo-images {
        flex-direction: column;
        align-items: center;
    }

    #promoSquare, #promoSquareFlat {
        width: 180px;
        height: 180px;
    }

    #promoStory, #promoStoryFlat {
        width: 120px;
        height: 213px;
    }
}
/* ============================================================================
   MESSAGING SYSTEM
   ============================================================================ */

/* Messages badge on button */
.messages-badge {
    background: var(--channel-accent);
    color: black;
    font-size: 10px;
    font-weight: bold;
    padding: 1px 5px;
    border-radius: 8px;
    margin-left: 4px;
}

.messages-badge:empty {
    display: none;
}

/* Message button in channel info (styled like pocket) */
.channel-info-message {
    font-size: 12px;
    opacity: 0.8;
    text-decoration: underline;
    cursor: pointer;
    display: block;
    transition: opacity 0.3s ease;
    pointer-events: auto;
    position: relative;
    z-index: 250;
    padding: 8px;
    padding-top: 4px;
    padding-bottom: 4px;
    margin-left: -8px;
}

.channel-info-message:hover {
    opacity: 1;
}

.channel-info-message:active {
    transform: scale(0.95);
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

/* Messages Inbox Overlay */
.messages-overlay {
    position: fixed;
    top: 0;
    right: 0;
    width: 350px;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 600;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.messages-overlay.open {
    transform: translateX(0);
}

.messages-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 18px;
}

.messages-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.messages-close:hover {
    opacity: 1;
}

.messages-compose-btn {
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    color: var(--channel-accent);
    font-size: 14px;
    transition: background 0.2s;
}

.messages-compose-btn:hover {
    background: rgba(255, 255, 255, 0.05);
}

.messages-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px 0;
}

.messages-empty {
    text-align: center;
    color: rgba(255, 255, 255, 0.4);
    padding: 40px 20px;
    font-size: 14px;
}

/* Conversation thread item */
.message-thread {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    gap: 12px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: background 0.2s;
}

.message-thread:hover {
    background: rgba(255, 255, 255, 0.05);
}

.message-thread.unread {
    background: rgba(255, 255, 255, 0.03);
}

.message-thread-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
}

.message-thread-content {
    flex: 1;
    min-width: 0;
}

.message-thread-name {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 4px;
}

.message-thread.unread .message-thread-name {
    font-weight: 700;
}

.message-thread-preview {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.message-thread-time {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.4);
    flex-shrink: 0;
}

.message-thread-unread-dot {
    width: 8px;
    height: 8px;
    background: var(--channel-accent);
    border-radius: 50%;
    flex-shrink: 0;
}

/* Compose Message Modal */
.compose-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 700;
    display: none;
    align-items: center;
    justify-content: center;
}

.compose-modal.open {
    display: flex;
}

.compose-container {
    background: rgba(20, 20, 20, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    width: 90%;
    max-width: 450px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.compose-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 16px;
}

.compose-close {
    background: none;
    border: none;
    color: white;
    font-size: 22px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.compose-close:hover {
    opacity: 1;
}

.compose-form {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.compose-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.compose-field label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    text-transform: lowercase;
}

.compose-recipient-field {
    position: relative;
}

.compose-field input[type="text"] {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    padding: 12px;
    color: white;
    font-family: Arial, sans-serif;
    font-size: 14px;
}

.compose-field input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.4);
}

.compose-field input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.compose-field textarea {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    padding: 12px;
    color: white;
    font-family: Arial, sans-serif;
    font-size: 14px;
    resize: vertical;
    min-height: 100px;
}

.compose-field textarea:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.4);
}

.compose-field textarea::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

/* Recipient autocomplete dropdown */
.recipient-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(30, 30, 30, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-top: none;
    border-radius: 0 0 4px 4px;
    max-height: 200px;
    overflow-y: auto;
    display: none;
    z-index: 10;
}

.recipient-dropdown.visible {
    display: block;
}

.recipient-option {
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: background 0.2s;
}

.recipient-option:hover {
    background: rgba(255, 255, 255, 0.1);
}

.recipient-option-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
}

.recipient-option-name {
    font-size: 14px;
}

.recipient-option-title {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    margin-left: 6px;
}

/* Image preview */
.compose-image-preview {
    display: none;
}

.compose-image-preview.visible {
    display: block;
}

.compose-image-preview img {
    max-width: 100%;
    max-height: 150px;
    border-radius: 4px;
}

.compose-image-preview .remove-image {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 20px;
    height: 20px;
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    color: white;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.compose-actions {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 10px;
}

.compose-attach {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.7);
    padding: 10px 16px;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.compose-attach:hover {
    border-color: rgba(255, 255, 255, 0.4);
    color: white;
}

.compose-send {
    background: var(--channel-accent);
    border: none;
    color: black;
    padding: 10px 24px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.2s;
}

.compose-send:hover {
    opacity: 0.9;
}

.compose-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.compose-error {
    color: #ff6b6b;
    font-size: 13px;
    text-align: center;
}

/* Conversation View Modal */
.conversation-modal {
    position: fixed;
    top: 0;
    right: 0;
    width: 350px;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 650;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.conversation-modal.open {
    transform: translateX(0);
}

.conversation-container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.conversation-header {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 16px;
}

.conversation-back {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    opacity: 0.7;
    padding: 0 5px;
}

.conversation-back:hover {
    opacity: 1;
}

.conversation-header span {
    flex: 1;
}

.conversation-close {
    background: none;
    border: none;
    color: white;
    font-size: 22px;
    cursor: pointer;
    opacity: 0.7;
}

.conversation-close:hover {
    opacity: 1;
}

.conversation-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.conversation-message {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.4;
}

.conversation-message.sent {
    align-self: flex-end;
    background: var(--channel-accent);
    color: black;
    border-bottom-right-radius: 4px;
}

.conversation-message.received {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-bottom-left-radius: 4px;
}

.conversation-message img {
    max-width: 100%;
    border-radius: 8px;
    margin-top: 8px;
}

.conversation-message-time {
    font-size: 10px;
    opacity: 0.6;
    margin-top: 4px;
}

.conversation-compose {
    padding: 15px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.conversation-compose textarea {
    width: 100%;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    padding: 10px;
    color: white;
    font-family: Arial, sans-serif;
    font-size: 14px;
    resize: none;
    min-height: 60px;
    box-sizing: border-box;
}

.conversation-compose textarea:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.4);
}

.conversation-compose textarea::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.conversation-image-preview {
    display: none;
    margin: 10px 0;
}

.conversation-image-preview.visible {
    display: block;
}

.conversation-image-preview img {
    max-width: 100%;
    max-height: 100px;
    border-radius: 4px;
}

.conversation-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
}

.conversation-attach {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.7);
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
}

.conversation-attach:hover {
    border-color: rgba(255, 255, 255, 0.4);
    color: white;
}

.conversation-send {
    background: var(--channel-accent);
    border: none;
    color: black;
    padding: 8px 18px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
}

.conversation-send:hover {
    opacity: 0.9;
}

/* Mobile responsive */
@media screen and (max-width: 768px) {
    .messages-overlay,
    .conversation-modal {
        width: 100%;
    }

    .compose-container {
        width: 95%;
        max-height: 90vh;
    }
}

/* Mobile landscape screening - fullscreen video experience */
@media screen and (max-width: 1024px) and (orientation: landscape) {
    body.screening-active .screening-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        z-index: 99999;
    }

    body.screening-active .screening-video {
        width: 100vw;
        height: 100vh;
        object-fit: contain;
    }

    /* Hide ALL UI elements during screening in landscape - clean viewing experience */
    body.screening-active .channel-avatar-container,
    body.screening-active .channel-info-display,
    body.screening-active .header-info,
    body.screening-active .typo-controls,
    body.screening-active .mobile-controls,
    body.screening-active .mobile-nav-buttons,
    body.screening-active .mobile-tv-controls,
    body.screening-active .mobile-screening-controls,
    body.screening-active .screening-fullscreen-btn,
    body.screening-active .age-daily-text,
    body.screening-active .channel-video-title,
    body.screening-active .screening-viewer-count,
    body.screening-active .screening-countdown-fixed,
    body.screening-active .screening-now-playing,
    body.screening-active .screening-owner-controls {
        display: none !important;
    }
}

/* ============================================================================
   SHOP - Stripe Connect Seller Shop Styles
   ============================================================================ */

/* Shop Tab in Pocket */
#pocketTabShop {
    /* Inherits .pocket-tab styles */
}

/* Shop Container in Pocket */
.pocket-shop-container {
    display: none;
    padding: 120px 20px 120px 20px;
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 10;
    overflow-y: auto;
    height: 100%;
    box-sizing: border-box;
}

/* Setup Banner - shown to owners without Stripe connected */
.shop-setup-banner {
    display: none;
    background: rgba(255, 255, 255, 0.05);
    border: 1px dashed rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    margin-bottom: 30px;
}

.shop-setup-banner p {
    color: rgba(255, 255, 255, 0.7);
    margin: 0 0 20px 0;
    font-size: 15px;
}

.shop-setup-banner button {
    background: white;
    color: black;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.2s;
}

.shop-setup-banner button:hover {
    opacity: 0.9;
}

.shop-setup-banner button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Products Grid */
.shop-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
    margin-bottom: 30px;
}

.shop-empty-state {
    grid-column: 1 / -1;
    text-align: center;
    color: rgba(255, 255, 255, 0.4);
    padding: 60px 20px;
    font-style: italic;
}

/* Product Card */
.shop-product-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
}

.shop-product-card:hover {
    transform: translateY(-3px);
    background: rgba(255, 255, 255, 0.08);
}

.shop-product-card.draft {
    opacity: 0.6;
}

.shop-product-image {
    position: relative;
    aspect-ratio: 1;
    background: rgba(255, 255, 255, 0.03);
    overflow: hidden;
}

.shop-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.shop-product-image .no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: rgba(255, 255, 255, 0.3);
    font-size: 11px;
}

.draft-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    background: rgba(255, 165, 0, 0.9);
    color: white;
    padding: 3px 6px;
    border-radius: 4px;
    font-size: 9px;
    font-weight: bold;
    text-transform: uppercase;
}

.shop-product-info {
    padding: 12px;
}

.shop-product-info h3 {
    margin: 0 0 6px 0;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.shop-product-price {
    font-size: 16px;
    font-weight: bold;
    margin: 0;
    color: #4ade80;
}

.shop-product-stock {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.5);
    margin: 4px 0 0 0;
}

/* Add Product Button */
.shop-add-btn {
    display: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: white;
    color: black;
    border: none;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    position: fixed;
    bottom: 100px;
    right: 20px;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.shop-add-btn:hover {
    transform: scale(1.05);
}

/* Product Detail Modal */
.shop-product-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
}

.shop-product-modal-content {
    background: #1a1a1a;
    border-radius: 16px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.shop-product-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    z-index: 1;
}

.shop-product-detail-image {
    aspect-ratio: 1;
    background: rgba(255, 255, 255, 0.05);
    overflow: hidden;
}

.shop-product-detail-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.shop-product-detail-info {
    padding: 20px;
}

.shop-product-detail-info h2 {
    margin: 0 0 10px 0;
    font-size: 20px;
}

.shop-product-detail-price {
    font-size: 24px;
    font-weight: bold;
    color: #4ade80;
    margin: 0 0 15px 0;
}

.shop-product-description {
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.5;
    margin: 0 0 15px 0;
    font-size: 14px;
}

.shop-buy-btn {
    width: 100%;
    background: #4ade80;
    color: black;
    border: none;
    padding: 14px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 15px;
}

.shop-buy-btn:hover {
    opacity: 0.9;
}

.shop-sold-out {
    color: #f87171;
    text-align: center;
    font-weight: bold;
    margin-top: 15px;
}

.shop-not-ready {
    color: rgba(255, 255, 255, 0.5);
    text-align: center;
    font-style: italic;
    margin-top: 15px;
}

.shop-owner-actions {
    display: flex;
    gap: 8px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.shop-owner-actions button {
    flex: 1;
    padding: 10px;
    font-size: 12px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.shop-owner-actions button.delete {
    background: rgba(248, 113, 113, 0.2);
    color: #f87171;
}

/* Product Editor Modal */
.shop-editor-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    padding: 20px;
}

.shop-editor-content {
    background: #1a1a1a;
    border-radius: 16px;
    max-width: 450px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

.shop-editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.shop-editor-header h3 {
    margin: 0;
    font-size: 16px;
}

.shop-editor-close {
    background: transparent;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
}

.shop-editor-form {
    padding: 20px;
}

.shop-form-group {
    margin-bottom: 16px;
}

.shop-form-group label {
    display: block;
    margin-bottom: 6px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
}

.shop-form-group input[type="text"],
.shop-form-group input[type="number"],
.shop-form-group input[type="url"],
.shop-form-group textarea {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    padding: 10px 12px;
    color: white;
    font-size: 14px;
    box-sizing: border-box;
}

.shop-form-group input:focus,
.shop-form-group textarea:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.4);
}

.shop-form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.shop-form-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
}

.shop-form-checkbox input {
    width: 16px;
    height: 16px;
}

.shop-form-checkbox label {
    margin: 0;
    font-size: 13px;
}

.shop-editor-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.shop-editor-actions button {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
}

.shop-editor-cancel {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.shop-editor-save {
    background: white;
    color: black;
    font-weight: 500;
}

/* Orders Section */
.shop-orders-section {
    display: none;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.shop-orders-section h3 {
    margin: 0 0 20px 0;
    font-size: 16px;
    color: rgba(255, 255, 255, 0.8);
}

.shop-orders-empty {
    color: rgba(255, 255, 255, 0.4);
    text-align: center;
    padding: 30px;
    font-style: italic;
}

.shop-order-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 12px;
}

.shop-order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.shop-order-header .order-id {
    font-family: monospace;
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
}

.shop-order-header .order-status {
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: bold;
    text-transform: uppercase;
}

.shop-order-card.status-pending .order-status {
    background: rgba(255, 165, 0, 0.2);
    color: orange;
}

.shop-order-card.status-paid .order-status {
    background: rgba(74, 222, 128, 0.2);
    color: #4ade80;
}

.shop-order-card.status-shipped .order-status {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
}

.shop-order-product {
    font-weight: 500;
    margin-bottom: 8px;
}

.shop-order-buyer {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 6px;
}

.shop-order-address {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 8px;
}

.shop-order-amount {
    font-size: 13px;
}

.shop-ship-btn {
    margin-top: 12px;
    background: #3b82f6;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
}

.shop-order-tracking {
    margin-top: 8px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    font-family: monospace;
}

/* Mobile Adjustments */
@media (max-width: 600px) {
    .shop-products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .shop-product-modal-content {
        max-height: 100vh;
        border-radius: 0;
    }

    .shop-add-btn {
        bottom: 80px;
        right: 15px;
    }
}

/* ==================== FEED OVERLAY - STACKED LAYOUT ==================== */
.feed-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: black;
    z-index: 200;
    display: none;
    overflow: hidden;
}

.feed-overlay.visible {
    display: block;
}

/* Feed header */
.feed-header {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 210;
}

.feed-title {
    font-family: Arial, sans-serif;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
    text-transform: lowercase;
}

/* Feed content container - scrollable */
.feed-content {
    position: absolute;
    top: 120px;
    left: 0;
    right: 0;
    height: calc(100% - 140px);
    overflow-y: auto;
    padding: 0 20px 60px;
    box-sizing: border-box;
}

/* Date section - horizontal layout with date on left */
.feed-date-section {
    display: flex;
    gap: 20px;
    margin-bottom: 40px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* Date label on the left */
.feed-date-label {
    flex-shrink: 0;
    width: 80px;
    padding-top: 8px;
    color: rgba(255, 255, 255, 0.4);
    font-family: Arial, sans-serif;
    font-size: 12px;
    text-align: right;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Content column - stacked items */
.feed-date-content {
    flex: 1;
    min-width: 0;
}

/* User section - contains a stack of items from one user */
.feed-user-section {
    position: relative;
    margin-bottom: 24px;
}

.feed-user-section:last-child {
    margin-bottom: 0;
}

/* Items stack - minimal gap between items */
.feed-items-stack {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

/* Individual stacked item */
.feed-stack-item {
    position: relative;
    display: inline-block;
    max-width: 100%;
}

/* Allow items to have natural width */
.feed-stack-item > div {
    display: inline-block;
}

/* Image items - natural size with max constraints */
.feed-stack-image {
    cursor: pointer;
    border-radius: 4px;
    overflow: hidden;
}

.feed-stack-image img {
    display: block;
    max-width: 100%;
    max-height: 400px;
    width: auto;
    height: auto;
}

/* Video items */
.feed-stack-video {
    position: relative;
    cursor: pointer;
    border-radius: 4px;
    overflow: hidden;
    display: inline-block;
}

.feed-stack-video img {
    display: block;
    max-width: 100%;
    max-height: 300px;
    width: auto;
    height: auto;
}

.feed-video-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    pointer-events: none;
}

/* Text items */
.feed-stack-text {
    display: inline-block;
    max-width: 400px;
    padding: 12px 16px;
    background: rgba(40, 40, 40, 0.8);
    border-radius: 8px;
    color: white;
    font-family: Georgia, serif;
    font-size: 15px;
    line-height: 1.5;
}

/* PDF items */
.feed-stack-pdf {
    position: relative;
    cursor: pointer;
    border-radius: 4px;
    overflow: hidden;
    display: inline-block;
}

.feed-stack-pdf img {
    display: block;
    max-width: 200px;
    max-height: 280px;
}

.feed-stack-pdf-label {
    display: block;
    padding: 8px 12px;
    background: rgba(40, 40, 40, 0.9);
    color: rgba(255, 255, 255, 0.8);
    font-family: Arial, sans-serif;
    font-size: 13px;
}

/* Avatar on last item of user stack */
.feed-stack-avatar {
    position: absolute;
    bottom: -8px;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    z-index: 10;
}

.feed-stack-avatar img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid black;
    background: #222;
}

.feed-stack-avatar-name {
    opacity: 0;
    color: rgba(255, 255, 255, 0.7);
    font-family: Arial, sans-serif;
    font-size: 12px;
    white-space: nowrap;
    transition: opacity 0.2s;
}

.feed-stack-avatar:hover .feed-stack-avatar-name {
    opacity: 1;
}

/* Avatar on right side (default for even groups) */
.feed-avatar-right .feed-stack-avatar {
    right: -8px;
    flex-direction: row-reverse;
}

.feed-avatar-right .feed-stack-avatar-name {
    transform: translateX(8px);
}

/* Avatar on left side (for odd groups) */
.feed-avatar-left .feed-stack-avatar {
    left: -8px;
    flex-direction: row;
}

.feed-avatar-left .feed-stack-avatar-name {
    transform: translateX(-8px);
}

/* Add padding for avatar on items that have it */
.feed-stack-item.has-avatar {
    padding-bottom: 16px;
}

/* Loading indicator */
.feed-loading {
    text-align: center;
    padding: 20px;
    color: rgba(255, 255, 255, 0.5);
    font-family: Arial, sans-serif;
    font-size: 14px;
}

/* Empty state */
.feed-empty {
    text-align: center;
    padding: 60px 20px;
    color: rgba(255, 255, 255, 0.4);
    font-family: Arial, sans-serif;
    font-size: 14px;
}

/* Hide feed overlay by default, show only when in feed mode */
body:not(.safari-feed-mode) .feed-overlay {
    display: none !important;
}

/* Feed image overlay */
.feed-image-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.feed-image-overlay-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
}

.feed-image-overlay-img {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    z-index: 1;
}

.feed-image-overlay-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 24px;
    cursor: pointer;
    z-index: 2;
}

.feed-image-overlay-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Feed video overlay */
.feed-video-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.feed-video-overlay-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
}

.feed-video-overlay-container {
    position: relative;
    width: 90%;
    max-width: 900px;
    aspect-ratio: 16 / 9;
    z-index: 1;
}

.feed-video-overlay-container iframe {
    width: 100%;
    height: 100%;
    border-radius: 8px;
}

.feed-video-overlay-close {
    position: absolute;
    top: -50px;
    right: 0;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 24px;
    cursor: pointer;
}

.feed-video-overlay-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Mobile responsiveness */
@media screen and (max-width: 768px) {
    .feed-content {
        padding: 0 12px 60px;
        top: 100px;
    }

    .feed-header {
        top: 60px;
    }

    .feed-date-section {
        flex-direction: column;
        gap: 8px;
    }

    .feed-date-label {
        width: auto;
        text-align: left;
        padding-top: 0;
        padding-left: 4px;
    }

    .feed-stack-image img,
    .feed-stack-video img {
        max-height: 300px;
    }

    .feed-stack-text {
        max-width: 85%;
    }

    .feed-video-overlay-container {
        width: 100%;
    }

    .feed-video-overlay-close {
        top: -45px;
        right: 10px;
    }
}

/* ===== FULLSCREEN ICON BUTTON ===== */

/* Fullscreen icon button - 4 corner segments */
.fullscreen-icon-btn {
    position: fixed;
    top: 25px;
    left: 15px;
    width: 18px;
    height: 18px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 201;
    padding: 0;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.fullscreen-icon-btn:hover {
    opacity: 1;
}

/* Corner segments */
.fullscreen-icon-corner {
    position: absolute;
    width: 6px;
    height: 6px;
    border-color: var(--channel-accent, white);
    border-style: solid;
    border-width: 0;
}

.fullscreen-icon-corner.tl {
    top: 0;
    left: 0;
    border-top-width: 2px;
    border-left-width: 2px;
}

.fullscreen-icon-corner.tr {
    top: 0;
    right: 0;
    border-top-width: 2px;
    border-right-width: 2px;
}

.fullscreen-icon-corner.bl {
    bottom: 0;
    left: 0;
    border-bottom-width: 2px;
    border-left-width: 2px;
}

.fullscreen-icon-corner.br {
    bottom: 0;
    right: 0;
    border-bottom-width: 2px;
    border-right-width: 2px;
}

/* CC (Closed Captions) button */
.cc-icon-btn {
    position: fixed;
    bottom: 25px;
    right: 40px;
    width: 18px;
    height: 18px;
    background: transparent;
    border: 2px solid var(--channel-accent, white);
    border-radius: 50%;
    cursor: pointer;
    z-index: 201;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.cc-icon-btn:hover {
    opacity: 1;
}

.cc-icon-btn.active {
    background: var(--channel-accent, white);
    opacity: 1;
}

.cc-icon-btn.active .cc-text {
    color: black;
}

.cc-text {
    font-size: 9px;
    font-weight: bold;
    color: var(--channel-accent, white);
    font-family: Arial, sans-serif;
    line-height: 1;
}

/* Caption language selector */
.caption-lang-selector {
    position: fixed;
    bottom: 50px;
    right: 20px;
    display: none;
    flex-direction: column;
    gap: 4px;
    background: rgba(0, 0, 0, 0.8);
    padding: 8px;
    border-radius: 8px;
    z-index: 300;
    max-height: 200px;
    overflow-y: auto;
}

.caption-lang-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    padding: 6px 12px;
    cursor: pointer;
    text-align: left;
    border-radius: 4px;
    white-space: nowrap;
}

.caption-lang-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.caption-lang-btn.active {
    background: var(--channel-accent, rgba(255, 255, 255, 0.2));
    color: white;
}

/* When captions are active, move owner buttons (programming, quill, rec, settings) to top left below fullscreen */
body.captions-active .owner-buttons {
    position: fixed !important;
    top: 55px !important;
    left: 15px !important;
    bottom: auto !important;
    right: auto !important;
    transform: none !important;
    flex-direction: column !important;
    gap: 6px !important;
}

/* CC settings gear icon - for language selection */
.cc-settings-btn {
    position: fixed;
    top: 15px;
    right: 55px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    font-size: 14px;
    padding: 4px;
    z-index: 201;
    display: none;
    transition: color 0.2s ease;
}

.cc-settings-btn:hover {
    color: white;
}

.cc-settings-btn svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

/* Show gear when captions are active and multiple languages available */
body.captions-active .cc-settings-btn.has-languages {
    display: block;
}

/* Caption language selector - dropdown from gear icon */
.caption-lang-selector {
    position: fixed;
    top: 40px;
    right: 45px;
    background: rgba(0, 0, 0, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 8px;
    z-index: 300;
    max-height: 200px;
    overflow-y: auto;
    display: none;
    flex-direction: column;
}

/* Hide on mobile */
@media screen and (max-width: 1024px) {
    .fullscreen-icon-btn,
    .cc-icon-btn,
    .cc-settings-btn,
    .caption-lang-selector {
        display: none !important;
    }
}

/* ===== FULLSCREEN MODE ===== */

/* Fullscreen mode - hide ALL UI */
body.fullscreen-mode {
    overflow: hidden;
    cursor: none;
}

/* Hide everything in fullscreen */
body.fullscreen-mode .header-info,
body.fullscreen-mode .channel-avatar-container,
body.fullscreen-mode .channel-info-display,
body.fullscreen-mode .channel-preview,
body.fullscreen-mode .antenna-dot,
body.fullscreen-mode .age-daily,
body.fullscreen-mode .typo-controls,
body.fullscreen-mode .mobile-controls,
body.fullscreen-mode #navInstructions,
body.fullscreen-mode .title-blocker,
body.fullscreen-mode .bottom-blocker,
body.fullscreen-mode .safari-channel-tabs,
body.fullscreen-mode .channel-live-badge,
body.fullscreen-mode .live-broadcast-indicator,
body.fullscreen-mode .owner-channel-selector,
body.fullscreen-mode #homeIndexButtons,
body.fullscreen-mode #desktopLogin,
body.fullscreen-mode #desktopLogout,
body.fullscreen-mode .mobile-nav-buttons,
body.fullscreen-mode .mobile-tv-controls,
body.fullscreen-mode .mobile-channel-arrows,
body.fullscreen-mode .mobile-skip-arrow,
body.fullscreen-mode .video-title-container,
body.fullscreen-mode .live-stream-waveform,
body.fullscreen-mode .fullscreen-icon-btn,
body.fullscreen-mode .cc-icon-btn,
body.fullscreen-mode .channel-nav-arrows,
body.fullscreen-mode .owner-buttons {
    opacity: 0 !important;
    pointer-events: none !important;
    transition: opacity 0.3s ease;
}

/* Expand video to fill viewport */
body.fullscreen-mode .video-container,
body.fullscreen-mode .video-wrapper,
body.fullscreen-mode #player {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 9999;
}

/* Direct product URL loading - hide shop catalogue until product is ready */
body.direct-product-loading .safari-catalog,
body.direct-product-loading .safari-catalog-grid,
body.direct-product-loading .safari-catalog-covers,
body.direct-product-loading .shop-backlist,
body.direct-product-loading .shop-featured,
body.direct-product-loading .shop-featured-info {
    opacity: 0 !important;
    pointer-events: none !important;
}

body.direct-product-loading .shop-overlay {
    background: black !important;
}

/* ===== MOBILE LANDSCAPE: FINAL OVERRIDE TO HIDE ALL TABS ===== */
/* This must be at the end of the file to override ALL other rules */
@media screen and (max-width: 1024px) and (orientation: landscape) {
    /* Hide channel tabs (tv/pocket/info) in ALL scenarios */
    .safari-channel-tabs,
    body .safari-channel-tabs,
    body.safari-channel-mode .safari-channel-tabs,
    body.safari-channel-pocket-mode .safari-channel-tabs,
    body.mobile-global-tabs .safari-channel-tabs,
    body.screening-active .safari-channel-tabs,
    body:has(.screening-overlay) .safari-channel-tabs,
    body:has(.notes-viewing-overlay.active) .safari-channel-tabs,
    body.safari-channel-mode:has(.notes-viewing-overlay.active) .safari-channel-tabs,
    body:has(.screening-overlay:not(.hidden)).safari-channel-pocket-mode .safari-channel-tabs,
    body:has(.screening-overlay:not(.hidden)):has(.notes-viewing-overlay.active) .safari-channel-tabs,
    body.screening-active.safari-channel-pocket-mode .safari-channel-tabs,
    body.screening-active:has(.notes-viewing-overlay.active) .safari-channel-tabs {
        display: none !important;
        opacity: 0 !important;
        visibility: hidden !important;
        pointer-events: none !important;
    }

    /* Also hide shop tabs in landscape */
    .safari-entry-tabs,
    body .safari-entry-tabs,
    body.safari-entry-mode .safari-entry-tabs {
        display: none !important;
        opacity: 0 !important;
        visibility: hidden !important;
        pointer-events: none !important;
    }

    /* Hide typo-controls on mobile landscape - use mobile-nav-buttons or hide all UI during screening */
    .typo-controls {
        display: none !important;
    }
}

/* ===== MOBILE PORTRAIT: SCREENING OVERLAY RESET ===== */
/* Ensure screening overlay is properly positioned after returning from landscape fullscreen */
/* IMPORTANT: Only apply when overlay is NOT hidden to avoid showing black screen on page load */
@media screen and (max-width: 1024px) and (orientation: portrait) {
    body.screening-active .screening-overlay:not(.hidden) {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        inset: 0 !important;
        width: 100% !important;
        height: 100% !important;
        transform: none !important;
        margin: 0 !important;
        padding: 0 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        background: black !important;
    }

    /* iOS Safari fullscreen exit fix - aggressive positioning reset */
    body.screening-active .screening-overlay:not(.hidden) .screening-live {
        position: relative !important;
        width: 100% !important;
        height: 100% !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        top: 0 !important;
        left: 0 !important;
        transform: none !important;
    }


    body.screening-active .screening-overlay:not(.hidden) .screening-video,
    body.screening-active .screening-overlay:not(.hidden) video#screeningVideo {
        position: relative !important;
        width: 100% !important;
        height: 100% !important;
        max-width: 100% !important;
        max-height: 100% !important;
        object-fit: contain !important;
        transform: none !important;
        margin: 0 auto !important;
        /* iOS Safari fullscreen exit leaves these - override them */
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        inset: unset !important;
    }
}

/* ===== SIMULATOR/MOBILE FIX: Force hide typo-controls on all small screens ===== */
/* This uses multiple detection methods to ensure mobile devices get the right UI */
@media screen and (max-width: 768px) {
    /* Definitely mobile - hide desktop controls */
    .typo-controls {
        display: none !important;
    }

    /* Show mobile nav buttons */
    .mobile-nav-buttons {
        display: flex !important;
    }
}

/* Also use pointer detection for touch devices */
@media (pointer: coarse) {
    .typo-controls {
        display: none !important;
    }
}

/* ===== FIX: Ensure screening video is visible ===== */
.screening-overlay:not(.hidden) .screening-live:not(.hidden) {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
}

.screening-overlay:not(.hidden) .screening-live:not(.hidden) .screening-video {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    background: black !important;
}

/* ===== SCREENING FULLSCREEN BUTTON: HIDE ON MOBILE ===== */
/* MUST be at end of file for maximum specificity */
/* Mobile doesn't need fullscreen button - landscape CSS handles full-screen viewing */

@media screen and (max-width: 1024px) {
    .screening-fullscreen-btn,
    body.screening-active .screening-fullscreen-btn,
    .screening-overlay .screening-fullscreen-btn {
        display: none !important;
        visibility: hidden !important;
        pointer-events: none !important;
    }
}

/* ===== CLEAN FULLSCREEN EXPERIENCE: HIDE ALL UI IN FULLSCREEN ===== */
/* When in native fullscreen, hide all our custom UI for clean viewing */
/* Note: iOS Safari's native video controls (X, volume, PIP) are controlled by iOS, not us */

.screening-overlay:fullscreen .screening-fullscreen-btn,
.screening-overlay:-webkit-full-screen .screening-fullscreen-btn,
.screening-overlay:fullscreen .screening-viewer-count,
.screening-overlay:-webkit-full-screen .screening-viewer-count,
.screening-overlay:fullscreen .screening-now-playing,
.screening-overlay:-webkit-full-screen .screening-now-playing,
.screening-overlay:fullscreen .screening-owner-controls,
.screening-overlay:-webkit-full-screen .screening-owner-controls,
.screening-overlay:fullscreen .mobile-nav-buttons,
.screening-overlay:-webkit-full-screen .mobile-nav-buttons {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* ===== FINAL OVERRIDE: Global channel mobile landscape = pure video, nothing else ===== */
@media screen and (max-width: 1024px) and (orientation: landscape) {
    body.global-channel-active:not(.safari-entry-mode) .landscape-channel-name,
    html.global-channel-active:not(.safari-entry-mode) .landscape-channel-name,
    body.global-channel-active:not(.safari-entry-mode) .channel-source-tag,
    body.global-channel-active:not(.safari-entry-mode) .channel-source-tag.visible,
    body.global-channel-active:not(.safari-entry-mode) .age-daily,
    body.global-channel-active:not(.safari-entry-mode) .mobile-global-title,
    body.global-channel-active:not(.safari-entry-mode) .global-channel-title,
    body.global-channel-active:not(.safari-entry-mode) .channel-info-display,
    body.global-channel-active:not(.safari-entry-mode) .channel-info-source,
    body.global-channel-active:not(.safari-entry-mode) .safari-channel-tabs,
    body.global-channel-active:not(.safari-entry-mode) .mobile-nav-buttons,
    body.global-channel-active:not(.safari-entry-mode) .mobile-tv-controls,
    body.global-channel-active:not(.safari-entry-mode) .mobile-stage-door,
    body.global-channel-active:not(.safari-entry-mode) .episode-title,
    body.global-channel-active:not(.safari-entry-mode) .channel-avatar-container,
    body.global-channel-active:not(.safari-entry-mode) .header-info {
        display: none !important;
        opacity: 0 !important;
        visibility: hidden !important;
    }
}
/* ===== COMMUNITY FEED OVERLAY ===== */
.community-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: #000;
    z-index: 190;
    overflow: hidden;
}
.community-overlay .community-scroll {
    top: 45px;
    position: absolute;
    left: 0; right: 0; bottom: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.community-overlay.visible { display: block; }

/* community-scroll positioning is set above in .community-overlay .community-scroll */
.community-inner {
    max-width: 520px; margin: 0 auto;
    padding: 16px 16px 120px;
}

/* Hide owner controls when community is open */
body.community-open #ownerButtons,
body.community-open #ownerMenuBtn,
body.community-open #ownerRecBtn,
body.community-open .owner-controls-bar {
    display: none !important;
}

/* Mobile pocket: only show quill in lower-right, hide all other owner controls */
@media (max-width: 768px) {
    body.safari-channel-pocket-mode #ownerMenuBtn,
    body.safari-channel-pocket-mode #ownerRecBtn,
    body.safari-channel-pocket-mode #ownerSettingsBtn,
    body.safari-channel-pocket-mode .owner-btn-text {
        display: none !important;
    }
    body.safari-channel-pocket-mode #ownerQuillBtn {
        display: flex !important;
        position: fixed !important;
        bottom: 25px !important;
        right: 15px !important;
        left: auto !important;
        z-index: 200 !important;
    }
    /* Hide the owner buttons container positioning so quill can be independent */
    body.safari-channel-pocket-mode #ownerButtons {
        position: static !important;
        display: contents !important;
    }
}

/* Hide avatar and fullscreen in community */
body.community-open .channel-avatar-container,
body.community-open .fullscreen-icon-btn {
    display: none !important;
}

/* Hide the activity sidebar */
body.community-open .community-sidebar {
    display: none !important;
}

/* Tabs and age-daily in community — just raise z-index above overlay (190) */
body.community-open .safari-channel-tabs {
    z-index: 999 !important;
}
body.community-open .age-daily {
    z-index: 195 !important;
}

/* Keep small age-daily visible in community, hide large title */
body.community-open .global-channel-title {
    display: none !important;
}

/* Hide CC, fullscreen, location in community */
body.community-open .fullscreen-icon-btn,
body.community-open .cc-icon-btn,
body.community-open #typoCCBtn,
body.community-open .channel-info-location {
    display: none !important;
}

/* "listening to" / "paused" label above video title — only in community */
.community-listening-label-inline {
    display: none;
    font-size: 14px;
    color: rgba(255,255,255,0.55);
    font-style: italic;
    margin-bottom: 2px;
    font-family: Georgia, serif;
}
body.community-open .community-listening-label-inline {
    display: block !important;
}

/* Show video title between "listening to" and "via" in community — desktop only */
@media (min-width: 769px) {
    body.community-open .channel-video-title {
        display: block !important;
        opacity: 1 !important;
        visibility: visible !important;
    }
}

/* "via" prefix on channel name — only in community */
.community-via-prefix {
    display: none;
    font-size: 11px;
    color: rgba(255,255,255,0.55);
    font-weight: 300;
}
body.community-open .community-via-prefix {
    display: inline !important;
}

/* Mobile green room: hide all channel info, nav, arrows; age-daily upper-right */
@media (max-width: 768px) {
    body.community-open .community-listening-label-inline,
    body.community-open .channel-video-title,
    body.community-open .community-via-prefix,
    body.community-open .channel-info-name,
    body.community-open .channel-info-display,
    body.community-open .channel-info-location,
    body.community-open .mobile-tv-controls,
    body.community-open .mobile-nav-buttons {
        display: none !important;
    }
    body.community-open .age-daily {
        display: block !important;
        opacity: 1 !important;
        visibility: visible !important;
        position: fixed !important;
        top: 12px !important;
        right: 15px !important;
        left: auto !important;
        bottom: auto !important;
        z-index: 195 !important;
    }
}

/* Mobile: hide age-daily logo in pocket */
@media (max-width: 768px) {
    body.safari-channel-pocket-mode .age-daily {
        display: none !important;
    }
}

/* Mobile: community compose fix — keep post button on screen */
@media (max-width: 768px) {
    .community-compose {
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        padding: 10px 12px !important;
        box-sizing: border-box !important;
        transform: none !important;
    }
    .community-compose .community-compose-inner {
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
    .community-compose-actions {
        flex-wrap: nowrap !important;
    }
}

/* Mobile landscape: community should show full-screen stage */
@media (max-width: 1024px) and (orientation: landscape) {
    .community-overlay {
        display: none !important;
    }
    body.community-open .community-overlay {
        display: none !important;
    }

    /* Pocket videos in landscape: fullscreen, no blockers */
    body:has(.pocket-viewing-overlay.active) .main-blocker,
    body:has(.pocket-viewing-overlay.active) .main-blocker-top,
    body:has(.pocket-viewing-overlay.active) .main-blocker-bottom,
    body:has(.pocket-viewing-overlay.active) .title-blocker,
    body:has(.pocket-viewing-overlay.active) .bottom-blocker {
        display: none !important;
    }
    .pocket-viewing-overlay.active {
        background: #000 !important;
    }
    .pocket-viewing-overlay.active .pocket-image-content,
    .pocket-viewing-overlay.active video,
    .pocket-viewing-overlay.active iframe {
        width: 100vw !important;
        height: 100vh !important;
        object-fit: contain !important;
    }
}

/* Channel name clickable in community */
body.community-open .channel-info-name {
    cursor: pointer;
}
body.community-open .channel-info-name:hover {
    text-decoration: underline;
}

/* Channel info visible in community */
body.community-open .channel-info-display {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    z-index: 195 !important;
}

/* Video title visible in community — desktop only */
@media (min-width: 769px) {
    body.community-open .channel-video-title {
        display: block !important;
        opacity: 1 !important;
        visibility: visible !important;
    }
}


/* Community layout — sidebar left, feed center */
.community-layout {
    display: flex;
    gap: 0;
    height: 100%;
}

/* Activity sidebar */
.community-sidebar {
    width: 200px;
    flex-shrink: 0;
    position: fixed;
    top: 50px;
    left: 0;
    bottom: 140px;
    overflow-y: auto;
    padding: 16px;
    border-right: 1px solid rgba(255,255,255,0.04);
    z-index: 185;
}
.community-sidebar-avatar {
    width: 48px; height: 48px; border-radius: 50%;
    overflow: hidden; margin-bottom: 8px;
    background: rgba(255,255,255,0.08);
}
.community-sidebar-avatar img { width: 100%; height: 100%; object-fit: cover; }
.community-sidebar-name {
    font-size: 13px; color: rgba(255,255,255,0.7);
    margin-bottom: 16px; font-family: Georgia, serif;
}

.community-activity-title {
    font-size: 10px; color: rgba(255,255,255,0.25);
    text-transform: uppercase; letter-spacing: 1px;
    margin-bottom: 10px;
}

.community-activity-item {
    font-size: 12px; color: rgba(255,255,255,0.4);
    margin-bottom: 10px; line-height: 1.5;
}
.community-activity-item strong { color: rgba(255,255,255,0.7); font-weight: normal; }
.community-activity-time {
    font-size: 9px; color: rgba(255,255,255,0.15);
    margin-top: 1px;
}
.community-activity-empty {
    font-size: 11px; color: rgba(255,255,255,0.12);
    font-style: italic;
}

/* Feed area — centered */
.community-overlay .community-scroll {
    margin-left: 0;
}
.community-inner {
    max-width: 520px; margin: 0 auto;
    padding: 56px 16px 160px;
}

/* Compose at bottom center */
.community-compose {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-width: none !important;
    transform: none !important;
    padding: 10px 16px !important;
    background: rgba(0,0,0,0.95) !important;
    border-top: 1px solid rgba(255,255,255,0.06) !important;
    z-index: 195 !important;
    box-sizing: border-box !important;
}
.community-compose .community-compose-inner {
    max-width: 520px;
    margin: 0 auto;
    width: 100%;
}

/* Compose — fixed at bottom center */
.community-compose {
    position: fixed;
    bottom: 60px; left: 50%; transform: translateX(-50%);
    width: 90%; max-width: 520px;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 6px; padding: 12px;
    background: rgba(0,0,0,0.95);
    z-index: 190;
    backdrop-filter: blur(10px);
}
.community-compose-text {
    width: 100%; min-height: 40px; padding: 8px; background: transparent;
    border: 1px solid rgba(255,255,255,0.08); border-radius: 4px;
    color: white; font-family: Georgia, serif; font-size: 14px;
    resize: vertical; line-height: 1.6;
}
.community-compose-text::placeholder { color: rgba(255,255,255,0.2); }
.community-compose-text:focus { outline: none; border-color: rgba(255,255,255,0.25); }
.community-compose-actions {
    display: flex; justify-content: space-between; align-items: center;
    margin-top: 10px; gap: 8px;
}
.community-compose-left { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.community-attach-btn {
    font-size: 11px; color: rgba(255,255,255,0.35); background: none;
    border: 1px solid rgba(255,255,255,0.1); padding: 3px 8px;
    border-radius: 3px; cursor: pointer; font-family: Georgia, serif;
}
.community-attach-btn:hover { color: white; border-color: rgba(255,255,255,0.25); }
.community-dest-toggle {
    display: flex; gap: 0; border: 1px solid rgba(255,255,255,0.1);
    border-radius: 3px; overflow: hidden;
}
.community-dest-btn {
    font-size: 10px; color: rgba(255,255,255,0.3); background: none; border: none;
    padding: 3px 8px; cursor: pointer; font-family: Georgia, serif;
    border-right: 1px solid rgba(255,255,255,0.08); transition: all 0.15s;
}
.community-dest-btn:last-child { border-right: none; }
.community-dest-btn.active { background: rgba(255,255,255,0.1); color: white; }
.community-dest-btn:hover { color: rgba(255,255,255,0.7); }
.community-dest-btn.disabled { opacity: 0.25; pointer-events: none; }
.community-post-btn {
    font-size: 12px; color: black; background: white;
    border: none; padding: 5px 16px; border-radius: 3px;
    cursor: pointer; font-family: Georgia, serif; flex-shrink: 0;
}
.community-post-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.community-media-preview { margin-top: 10px; display: none; position: relative; }
.community-media-preview img { max-width: 100%; max-height: 120px; border-radius: 4px; object-fit: cover; }
.community-media-remove {
    position: absolute; top: 6px; right: 6px; width: 20px; height: 20px;
    background: rgba(0,0,0,0.7); color: white; border: none; border-radius: 50%;
    cursor: pointer; font-size: 12px; display: flex; align-items: center; justify-content: center;
}

/* Feed posts */
.community-post {
    border-bottom: 1px solid rgba(255,255,255,0.04);
    padding: 16px 0;
}

/* Own posts — left aligned (default, no changes needed) */

/* Other users' posts — right aligned */
.community-post-other .community-post-header {
    flex-direction: row-reverse;
}
.community-post-other .community-post-content {
    text-align: right;
}
.community-post-other .community-post-media {
    display: flex;
    justify-content: flex-end;
}
.community-post-other .community-post-actions {
    flex-direction: row-reverse;
}

/* Comments stay left-aligned regardless */
.community-post-other .community-comments {
    text-align: left;
}
.community-post-other .community-comments .community-comment {
    text-align: left;
}
.community-post-other .community-comments .community-comment-row {
    text-align: left;
}

/* Notifications stay left-aligned */
.community-post-other .community-notifs {
    text-align: left;
}
.community-post-header {
    display: flex; align-items: center; gap: 10px; margin-bottom: 8px;
}
.community-post-avatar {
    width: 28px; height: 28px; border-radius: 50%;
    background: rgba(255,255,255,0.08); overflow: hidden; flex-shrink: 0;
}
.community-post-avatar img { width: 100%; height: 100%; object-fit: cover; }
.community-post-author { font-size: 13px; color: rgba(255,255,255,0.7); }
.community-post-author a { color: rgba(255,255,255,0.7); text-decoration: none; }
.community-post-author a:hover { color: white; }
.community-post-time { font-size: 10px; color: rgba(255,255,255,0.2); margin-left: 6px; }
.community-post-content {
    font-size: 14px; line-height: 1.7; color: rgba(255,255,255,0.8);
    margin-bottom: 8px; white-space: pre-wrap;
}
.community-post-media { margin-bottom: 8px; border-radius: 4px; overflow: hidden; }
.community-post-media img { width: 100%; display: block; }
.community-post-actions {
    display: flex; gap: 14px; align-items: center;
}

/* Inline notifications beneath post */
.community-notifs { display: none; padding: 8px 0 4px; }
.community-notifs.visible { display: block; }
.community-notif-inline {
    font-size: 11px; color: rgba(255,255,255,0.35);
    padding: 3px 0; line-height: 1.5;
}
.community-notif-inline strong { color: rgba(255,255,255,0.55); font-weight: normal; }
.community-notif-inline-time { color: rgba(255,255,255,0.15); font-size: 9px; }

/* Lightning bolt */
.community-bolt-btn { font-size: 13px !important; }

/* Like message */
.community-like-msg {
    font-size: 11px;
    color: rgba(255,255,255,0.4);
    font-style: italic;
    font-family: Georgia, serif;
    position: absolute;
    bottom: 0;
    white-space: nowrap;
    opacity: 1;
    transition: opacity 0.5s ease;
    pointer-events: none;
}
.community-like-msg.align-left { right: 100%; margin-right: 8px; }
.community-like-msg.align-right { left: 100%; margin-left: 8px; }
.community-like-msg.fade-out { opacity: 0; }

/* Make post-actions relative for message positioning */
.community-post-actions { position: relative; }

/* Pocket reblog indicator */
.pocket-reblog-tag {
    position: absolute;
    bottom: 4px;
    right: 6px;
    font-size: 10px;
    color: var(--channel-accent, rgba(255,255,255,0.5));
    text-decoration: none;
    display: flex;
    align-items: center;
    pointer-events: auto;
    z-index: 5;
    text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}
.pocket-reblog-tag:hover { color: white; }
.pocket-reblog-tag svg { stroke: currentColor; }

/* On hover: icon becomes "pocketed from", full name becomes first name */
.pocket-reblog-tag .pocket-reblog-icon { display: inline; }
.inventory-item:hover .pocket-reblog-tag .pocket-reblog-icon {
    font-size: 9px;
}
.inventory-item:hover .pocket-reblog-tag .pocket-reblog-icon svg { display: none; }
.inventory-item:hover .pocket-reblog-tag .pocket-reblog-icon::after {
    content: 'pocketed from ';
}
.inventory-item:hover .pocket-reblog-tag .pocket-reblog-name {
    display: none;
}
.inventory-item:hover .pocket-reblog-tag::after {
    content: attr(data-first);
}
.community-action {
    font-size: 11px; color: rgba(255,255,255,0.25); background: none; border: none;
    cursor: pointer; font-family: Georgia, serif; padding: 0;
    display: flex; align-items: center; gap: 3px;
}
.community-action:hover { color: rgba(255,255,255,0.6); }
.community-action.pocketed { color: rgba(255,255,255,0.5); }

/* Heart */
.community-heart-btn { position: relative; }
.community-heart-btn svg { width: 14px; height: 14px; vertical-align: middle; }
@keyframes communityFloatHeart {
    0% { opacity: 1; transform: translateY(0) scale(1); }
    60% { opacity: 0.8; transform: translateY(-30px) scale(1.2); }
    100% { opacity: 0; transform: translateY(-50px) scale(0.8); }
}
.community-floating-heart {
    position: absolute; top: -5px; left: 0; pointer-events: none;
    animation: communityFloatHeart 0.8s ease-out forwards;
    color: #e63946; font-size: 16px;
}

/* Comments */
.community-comments { margin-top: 8px; padding-left: 38px; display: none; }
.community-comments.visible { display: block; }
.community-comment { margin-bottom: 8px; }
.community-comment-author { font-size: 11px; color: rgba(255,255,255,0.4); }
.community-comment-text { font-size: 13px; color: rgba(255,255,255,0.65); line-height: 1.5; margin-top: 1px; }
.community-comment-time { font-size: 9px; color: rgba(255,255,255,0.15); }
.community-comment-row { display: flex; gap: 6px; margin-top: 8px; }
.community-comment-input {
    flex: 1; padding: 5px 8px; background: transparent;
    border: 1px solid rgba(255,255,255,0.08); border-radius: 3px;
    color: white; font-family: Georgia, serif; font-size: 12px;
}
.community-comment-input:focus { outline: none; border-color: rgba(255,255,255,0.25); }
.community-comment-submit {
    font-size: 10px; color: rgba(255,255,255,0.3); background: none;
    border: 1px solid rgba(255,255,255,0.1); padding: 3px 8px;
    border-radius: 3px; cursor: pointer; font-family: Georgia, serif;
}
.community-post-delete {
    font-size: 10px; color: rgba(255,255,255,0.1); cursor: pointer;
    margin-left: auto; background: none; border: none; font-family: Georgia, serif;
}
.community-post-delete:hover { color: #ff6b6b; }
.community-empty {
    text-align: center; color: rgba(255,255,255,0.15);
    font-style: italic; padding: 50px 20px; font-size: 14px;
}

/* Notifications */
.community-notif-overlay {
    display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.95); z-index: 210; overflow-y: auto; padding: 60px 20px;
}
.community-notif-overlay.visible { display: block; }
.community-notif-box { max-width: 400px; margin: 0 auto; }
.community-notif-header {
    display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px;
}
.community-notif-header span { font-size: 15px; color: rgba(255,255,255,0.5); font-style: italic; }
.community-notif-header button {
    font-size: 20px; color: rgba(255,255,255,0.4);
    background: none; border: none; cursor: pointer;
}
.community-notif-item {
    padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,0.04);
    font-size: 13px; color: rgba(255,255,255,0.5);
}
.community-notif-item.unseen { color: rgba(255,255,255,0.9); }
.community-notif-time { font-size: 10px; color: rgba(255,255,255,0.2); margin-top: 2px; }
.community-notif-empty { color: rgba(255,255,255,0.15); font-style: italic; padding: 20px 0; }

/* Notif dot on button */
.community-notif-dot {
    display: inline-block; width: 5px; height: 5px;
    background: #e63946; border-radius: 50%; margin-left: 3px; vertical-align: middle;
}
