:root {
            --bg-primary: #0a0a0b;
            --bg-secondary: #1a1a1d;
            --bg-card: #252529;
            --accent-green: #00ff88;
            --accent-orange: #ff6b35;
            --accent-red: #ff3366;
            --text-primary: #ffffff;
            --text-secondary: #a8a8b3;
            --text-muted: #6c6c78;
            --border: #333338;
            --shadow: 0 8px 32px rgba(0, 255, 136, 0.1);
        }

        * { margin: 0; padding: 0; box-sizing: border-box; }

        body {
            font-family: 'Space Grotesk', sans-serif;
            background: var(--bg-primary);
            color: var(--text-primary);
            line-height: 1.6;
            overflow-x: hidden;
        }

        .container { max-width: 1400px; margin: 0 auto; padding: 2rem; }

        /* ── Splash Screen ── */
        .splash {
            min-height: 80vh;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            text-align: center;
            animation: fadeIn 0.5s ease;
        }
        @keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
        @keyframes fadeOut { from { opacity: 1; } to { opacity: 0; transform: translateY(-10px); } }

        .splash h1 {
            font-size: clamp(2rem, 5vw, 3.5rem);
            font-weight: 700;
            background: linear-gradient(135deg, var(--accent-green), var(--accent-orange));
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            margin-bottom: 0.5rem;
        }
        .splash .tagline {
            color: var(--text-secondary);
            font-size: 1.1rem;
            margin-bottom: 2.5rem;
        }
        .version-tag {
            display: inline-block;
            font-family: 'JetBrains Mono', monospace;
            font-size: 0.65rem;
            background: var(--accent-green);
            color: var(--bg-primary);
            padding: 2px 8px;
            border-radius: 4px;
            margin-left: 0.5rem;
            vertical-align: super;
            font-weight: 700;
        }

        .splash-cards {
            display: flex;
            gap: 2rem;
            justify-content: center;
            flex-wrap: wrap;
        }
        .splash-card {
            background: var(--bg-secondary);
            border: 2px solid var(--border);
            border-radius: 16px;
            padding: 2rem 2.5rem;
            cursor: pointer;
            transition: all 0.3s ease;
            text-align: center;
            width: 280px;
            position: relative;
            overflow: hidden;
        }
        .splash-card:hover {
            border-color: var(--accent-green);
            transform: translateY(-4px);
            box-shadow: 0 12px 40px rgba(0, 255, 136, 0.15);
        }
        .splash-card:active { transform: translateY(-2px); }
        .splash-card img {
            width: 120px; height: auto;
            margin-bottom: 1rem;
            filter: drop-shadow(0 8px 20px rgba(0,0,0,0.3));
        }
        .splash-card h2 { font-size: 1.2rem; font-weight: 700; margin-bottom: 0.5rem; }
        .splash-card p { font-size: 0.85rem; color: var(--text-muted); }
        .card-badge {
            font-family: 'JetBrains Mono', monospace;
            font-size: 0.6rem;
            padding: 3px 8px;
            border-radius: 4px;
            margin-top: 0.75rem;
            display: inline-block;
        }
        .card-badge.live { background: rgba(0,255,136,0.15); color: var(--accent-green); }
        .card-badge.static { background: rgba(139,92,246,0.15); color: #8b5cf6; }

        .splash-status {
            margin-top: 2rem;
            font-family: 'JetBrains Mono', monospace;
            font-size: 0.75rem;
            color: var(--text-muted);
            min-height: 1.5rem;
        }
        .splash-status.ready { color: var(--accent-green); }
        .splash-status.error { color: var(--accent-red); }

        /* ── Hero compact ── */
        .hero-compact {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 1rem;
            margin-bottom: 1rem;
        }
        .hero-compact h1 {
            font-size: 1.5rem;
            font-weight: 700;
            background: linear-gradient(135deg, var(--accent-green), var(--accent-orange));
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
        }

        /* ── Mode Switcher ── */
        .mode-switcher {
            display: flex;
            justify-content: center;
            gap: 0.25rem;
            margin-bottom: 1rem;
            background: var(--bg-secondary);
            border-radius: 10px;
            padding: 4px;
            width: fit-content;
            margin-left: auto; margin-right: auto;
        }
        .mode-btn {
            background: none;
            border: none;
            color: var(--text-muted);
            padding: 0.5rem 1.25rem;
            border-radius: 8px;
            font-family: 'JetBrains Mono', monospace;
            font-size: 0.75rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s ease;
        }
        .mode-btn:hover { color: var(--text-primary); }
        .mode-btn.active { background: var(--accent-green); color: var(--bg-primary); }

        /* ── Source badge ── */
        .source-bar {
            display: flex; gap: 0.5rem;
            justify-content: center; flex-wrap: wrap;
            margin-bottom: 1rem;
            font-family: 'JetBrains Mono', monospace;
            font-size: 0.7rem;
        }
        .source-badge {
            padding: 0.3rem 0.6rem;
            border-radius: 6px;
            display: flex; align-items: center; gap: 0.35rem;
        }
        .source-badge.ok { background: rgba(0,255,136,0.1); color: var(--accent-green); border: 1px solid rgba(0,255,136,0.2); }
        .source-badge.warn { background: rgba(255,107,53,0.1); color: var(--accent-orange); border: 1px solid rgba(255,107,53,0.2); }
        .source-badge.err { background: rgba(255,51,102,0.1); color: var(--accent-red); border: 1px solid rgba(255,51,102,0.2); }

        /* ── Presets ── */
        .presets {
            background: var(--bg-secondary);
            border: 1px solid var(--border);
            border-radius: 12px;
            padding: 1rem;
            margin-bottom: 1rem;
            display: flex; gap: 0.75rem;
            justify-content: center; flex-wrap: wrap;
        }
        .preset-btn {
            background: var(--bg-card);
            border: 1px solid var(--border);
            color: var(--text-primary);
            padding: 0.5rem 1rem;
            border-radius: 8px;
            font-family: 'JetBrains Mono', monospace;
            font-size: 0.8rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s ease;
            text-transform: uppercase;
            letter-spacing: 0.1em;
        }
        .preset-btn:hover, .preset-btn.active {
            background: var(--accent-green);
            color: var(--bg-primary);
            border-color: var(--accent-green);
        }

        /* ── Controls / Sliders ── */
        .controls {
            background: var(--bg-secondary);
            border: 1px solid var(--border);
            border-radius: 12px;
            padding: 1rem;
            margin-bottom: 1.5rem;
            box-shadow: var(--shadow);
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
            gap: 2rem;
        }
        .filter-group {
            padding: 0.75rem;
            background: var(--bg-card);
            border-radius: 8px;
            border: 1px solid rgba(255,255,255,0.05);
        }
        .filter-label {
            font-family: 'JetBrains Mono', monospace;
            font-size: 0.8rem; font-weight: 600;
            color: var(--accent-green);
            margin-bottom: 0.5rem;
            text-transform: uppercase; letter-spacing: 0.1em;
            display: flex; align-items: center; gap: 0.5rem;
        }
        .filter-icon { width: 12px; height: 12px; border-radius: 50%; }
        .icon-sex { background: var(--accent-orange); }
        .icon-violence { background: var(--accent-red); }
        .icon-language { background: #8b5cf6; }

        .range-container { margin-top: 0.75rem; }
        .range-slider {
            position: relative; height: 6px;
            background: var(--bg-primary);
            border-radius: 3px;
            border: 1px solid var(--border);
        }
        .range-track {
            position: absolute; height: 100%;
            border-radius: 3px;
            background: var(--accent-green);
            transition: left 0.25s ease, width 0.25s ease;
        }
        .range-input {
            position: absolute; top: 0;
            width: 100%; height: 6px;
            background: transparent;
            -webkit-appearance: none; appearance: none;
            pointer-events: none;
        }
        .range-input::-webkit-slider-thumb {
            -webkit-appearance: none;
            width: 18px; height: 18px;
            border-radius: 50%;
            background: var(--accent-green);
            border: 2px solid var(--bg-primary);
            box-shadow: 0 0 0 3px rgba(255,255,255,0.1), 0 6px 14px rgba(0,0,0,0.4);
            pointer-events: all; cursor: pointer;
        }
        .range-input::-moz-range-thumb {
            width: 18px; height: 18px;
            border-radius: 50%;
            background: var(--accent-green);
            border: 2px solid var(--bg-primary);
            box-shadow: 0 0 0 3px rgba(255,255,255,0.1), 0 6px 14px rgba(0,0,0,0.4);
            pointer-events: all; cursor: pointer;
        }
        .range-values {
            position: absolute;
            top: -30px; left: 50%;
            transform: translateX(-50%);
            background: var(--accent-green);
            color: var(--bg-primary);
            padding: 2px 8px;
            border-radius: 8px;
            font-family: 'JetBrains Mono', monospace;
            font-size: 0.7rem; font-weight: 600;
        }
        .scale-labels {
            display: flex; justify-content: space-between;
            margin-top: 0.4rem;
            font-family: 'JetBrains Mono', monospace;
            font-size: 0.6rem; color: var(--text-muted);
        }

        /* ── Stats ── */
        .stats {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-top: 2rem;
            padding: 1rem;
            background: var(--bg-secondary);
            border-radius: 12px;
            font-family: 'JetBrains Mono', monospace;
        }
        .stat { text-align: center; }
        .stat-value { font-size: 1.5rem; font-weight: 700; color: var(--accent-green); }
        .stat-label { font-size: 0.8rem; color: var(--text-muted); text-transform: uppercase; }

        /* ── Movie Table ── */
        .movies-table {
            background: var(--bg-card);
            border: 1px solid var(--border);
            border-radius: 12px;
            overflow: hidden;
        }
        .table-header {
            background: var(--bg-secondary);
            padding: 1rem;
            border-bottom: 1px solid var(--border);
            display: grid;
            grid-template-columns: 50px 70px 2fr 30px 50px 50px 50px 50px;
            gap: 0.75rem;
            align-items: center;
            font-family: 'JetBrains Mono', monospace;
            font-size: 0.75rem; font-weight: 600;
            color: var(--accent-green);
            text-transform: uppercase; letter-spacing: 0.1em;
        }
        .movie-row {
            padding: 0.5rem 1rem;
            border-bottom: 1px solid rgba(255, 255, 255, 0.05);
            display: grid;
            grid-template-columns: 50px 70px 2fr 30px 50px 50px 50px 50px;
            gap: 0.75rem;
            align-items: center;
            transition: all 0.3s ease;
        }
        .movie-row:last-child { border-bottom: none; }
        .movie-row:hover { background: rgba(0, 255, 136, 0.05); }
        .movie-row.filtered-out { opacity: 0.3; filter: grayscale(1); }

        .movie-poster {
            width: 40px; height: 60px;
            border-radius: 4px;
            object-fit: cover;
            background: var(--bg-secondary);
            border: 1px solid var(--border);
        }
        .movie-poster-placeholder {
            width: 40px; height: 60px;
            border-radius: 4px;
            background: var(--bg-secondary);
            border: 1px solid var(--border);
            display: flex; align-items: center; justify-content: center;
            font-size: 1rem; color: var(--text-muted);
        }

        .movie-name { font-weight: 500; }
        .movie-link {
            color: var(--text-primary);
            transition: color 0.3s ease;
        }
        .movie-row:hover .movie-link { color: var(--accent-green); }

        .rating-cell {
            text-align: center;
            font-family: 'JetBrains Mono', monospace;
            font-size: 0.85rem; font-weight: 600;
            padding: 4px 6px;
            border-radius: 6px;
        }
        .rating-sex { background: rgba(255, 107, 53, 0.2); color: var(--accent-orange); }
        .rating-violence { background: rgba(255, 51, 102, 0.2); color: var(--accent-red); }
        .rating-language { background: rgba(139, 92, 246, 0.2); color: #8b5cf6; }
        .rating-total { background: rgba(0, 255, 136, 0.2); color: var(--accent-green); }

        .mpaa-rating {
            font-family: 'JetBrains Mono', monospace;
            font-size: 0.75rem; font-weight: 700;
            padding: 4px 6px;
            border-radius: 6px;
            text-align: center;
        }
        .mpaa-g { background: rgba(34, 197, 94, 0.2); color: #22c55e; }
        .mpaa-pg { background: rgba(59, 130, 246, 0.2); color: #3b82f6; }
        .mpaa-pg13 { background: rgba(251, 191, 36, 0.2); color: #fbbf24; }
        .mpaa-r { background: rgba(239, 68, 68, 0.2); color: #ef4444; }
        .mpaa-unknown { background: rgba(156, 163, 175, 0.2); color: #9ca3af; }

        .section-badge {
            font-family: 'JetBrains Mono', monospace;
            font-size: 0.55rem;
            padding: 1px 5px;
            border-radius: 3px;
            text-transform: uppercase; letter-spacing: 0.05em;
            display: inline-block;
            margin-top: 2px;
        }
        .section-week { background: rgba(139,92,246,0.2); color: #8b5cf6; }

        /* ── Seen toggle ── */
        .seen-btn {
            background: none;
            border: 1px solid var(--border);
            border-radius: 50%;
            width: 26px; height: 26px;
            display: flex; align-items: center; justify-content: center;
            cursor: pointer;
            font-size: 0.7rem;
            transition: all 0.2s ease;
            color: var(--text-muted);
        }
        .seen-btn:hover { border-color: var(--accent-green); color: var(--accent-green); }
        .seen-btn.active {
            background: rgba(0,255,136,0.15);
            border-color: var(--accent-green);
            color: var(--accent-green);
        }

        /* ── Spinner ── */
        @keyframes spin { to { transform: rotate(360deg); } }
        .spinner-sm {
            display: inline-block;
            width: 14px; height: 14px;
            border: 2px solid var(--border);
            border-top-color: var(--accent-green);
            border-radius: 50%;
            animation: spin 0.8s linear infinite;
            vertical-align: middle;
            margin-right: 0.35rem;
        }

        /* ── Mobile ── */
        @media (max-width: 768px) {
            .splash-cards { flex-direction: column; align-items: center; }
            .splash-card { width: 100%; max-width: 300px; }
            .presets { flex-direction: column; gap: 0.5rem; }
            .container { padding: 1rem; }
            .controls { grid-template-columns: 1fr; gap: 1rem; padding: 0.75rem; }
            .filter-group { padding: 0.5rem; }
            .table-header, .movie-row {
                grid-template-columns: 35px 50px 2fr 24px 35px 35px 35px 35px;
                gap: 0.3rem; font-size: 0.75rem;
                padding: 0.4rem 0.5rem;
            }
            .movie-poster, .movie-poster-placeholder { width: 30px; height: 45px; }
            .movie-name { font-size: 0.85rem; }
            .rating-cell, .mpaa-rating { font-size: 0.65rem; padding: 2px 3px; }
            .seen-btn { width: 22px; height: 22px; font-size: 0.6rem; }
        }

/* ── Movie Detail Modal ── */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    backdrop-filter: blur(4px);
}
.modal-overlay.active {
    display: flex;
    animation: fadeIn 0.2s ease;
}
.modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 16px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 2rem;
    position: relative;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
}
.modal-close {
    position: absolute;
    top: 1rem; right: 1rem;
    background: none;
    border: 1px solid var(--border);
    color: var(--text-muted);
    width: 36px; height: 36px;
    border-radius: 50%;
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}
.modal-close:hover {
    border-color: var(--accent-red);
    color: var(--accent-red);
    background: rgba(255, 51, 102, 0.1);
}
.modal-loading {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
}
.modal-layout {
    display: flex;
    gap: 1.5rem;
}
.modal-poster-col {
    flex-shrink: 0;
}
.modal-poster {
    width: 200px;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}
.modal-poster-placeholder {
    width: 200px;
    height: 300px;
    border-radius: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: var(--text-muted);
}
.modal-info-col {
    flex: 1;
    min-width: 0;
}
.modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    padding-right: 2rem;
}
.modal-meta {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}
.modal-badges {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}
.modal-tmdb-rating {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    color: #fbbf24;
}
.modal-tmdb-votes {
    font-size: 0.7rem;
    color: var(--text-muted);
}
.modal-overview {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1rem;
}
.modal-credit {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}
.modal-credit-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-right: 0.5rem;
}
.modal-ratings-section {
    margin-top: 1.25rem;
    padding: 1rem;
    background: var(--bg-card);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}
.modal-ratings-header {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--accent-green);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.75rem;
}
.modal-rating-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}
.modal-rating-row:last-child {
    margin-bottom: 0;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}
.modal-rating-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65rem;
    color: var(--text-muted);
    width: 100px;
    flex-shrink: 0;
    text-transform: uppercase;
}
.modal-rating-bar-bg {
    flex: 1;
    height: 8px;
    background: var(--bg-primary);
    border-radius: 4px;
    overflow: hidden;
}
.modal-rating-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.4s ease;
}
.modal-rating-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    font-weight: 700;
    width: 28px;
    text-align: right;
}
.modal-actions {
    margin-top: 1.25rem;
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.modal-link-btn {
    display: inline-block;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    text-decoration: none;
    background: rgba(0, 255, 136, 0.1);
    color: var(--accent-green);
    border: 1px solid rgba(0, 255, 136, 0.2);
    transition: all 0.2s;
}
.modal-link-btn:hover {
    background: rgba(0, 255, 136, 0.2);
    border-color: var(--accent-green);
}
.modal-link-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    border-color: var(--border);
}
.modal-link-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

/* ── Modal Mobile ── */
@media (max-width: 768px) {
    .modal-overlay { padding: 1rem; }
    .modal-content { padding: 1.25rem; }
    .modal-layout { flex-direction: column; align-items: center; text-align: center; }
    .modal-poster { width: 150px; }
    .modal-poster-placeholder { width: 150px; height: 225px; font-size: 2rem; }
    .modal-title { font-size: 1.25rem; padding-right: 0; }
    .modal-badges { justify-content: center; }
    .modal-rating-label { width: 70px; font-size: 0.6rem; }
    .modal-actions { justify-content: center; }
}

/* ── KIM Detail Accordions ── */
.kim-details {
    margin-top: 1.25rem;
    padding: 1rem;
    background: var(--bg-card);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}
.kim-details-header {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--accent-green);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.75rem;
}
.kim-loading {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: var(--text-muted);
    padding: 0.5rem 0;
}
.kim-accordion {
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    margin-bottom: 0.5rem;
    overflow: hidden;
    background: var(--bg-primary);
}
.kim-accordion:last-child { margin-bottom: 0; }
.kim-accordion-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.75rem;
    cursor: pointer;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    transition: color 0.2s;
    list-style: none;
}
.kim-accordion-title::-webkit-details-marker { display: none; }
.kim-accordion-title::marker { display: none; content: ''; }
.kim-accordion-title:hover { color: var(--text-primary); }
.kim-accordion-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.kim-accordion-arrow {
    margin-left: auto;
    transition: transform 0.2s ease;
    color: var(--text-muted);
    font-size: 0.7rem;
}
.kim-accordion[open] .kim-accordion-arrow {
    transform: rotate(90deg);
}
.kim-accordion[open] .kim-accordion-title {
    color: var(--text-primary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.kim-accordion-body {
    padding: 0.75rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.7;
}
.kim-accordion-body p {
    margin: 0;
}
.kim-bullet {
    color: var(--accent-green);
    font-weight: bold;
    font-size: 0.7rem;
    margin-right: 0.15rem;
}
@media (max-width: 768px) {
    .kim-accordion-title { font-size: 0.7rem; padding: 0.5rem 0.6rem; }
    .kim-accordion-body { font-size: 0.75rem; padding: 0.6rem; }
}