/* === LANDSCAPE — Design Tokens === */
:root {
    --bg: #F4F4F4;
    --bg-card: #FFFFFF;
    --bg-hover: #EDEDEC;
    --text: #1a1a2e;
    --text-muted: #6b6b7b;
    --accent: #3B5EFF;
    --accent-hover: #2a4bdb;
    --accent-light: rgba(59, 94, 255, 0.08);
    --border: #e0e0e0;
    --border-light: #ebebeb;
    --success: #2d6a4f;
    --radius: 8px;
    --radius-sm: 6px;
}

/* === Reset & Base === */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'IBM Plex Sans', -apple-system, sans-serif;
    font-size: 14px;
    font-weight: 400;
    color: var(--text);
    background: var(--bg);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* === Header === */
.top-bar {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    height: 48px;
    padding: 0 20px;
    background: #fff;
    border-bottom: 1px solid var(--border);
}

.logo {
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 2.5px;
    color: var(--text);
}

.header-tabs {
    display: flex;
    gap: 4px;
    margin-left: auto;
}

.header-tab {
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    padding: 6px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: #fff;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s ease;
}

.header-tab:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.header-tab.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

/* === Layout === */
.app-layout {
    display: flex;
    height: calc(100vh - 48px);
}

/* === Sidebar === */
.sidebar {
    width: 280px;
    min-width: 280px;
    background: #fff;
    border-right: 1px solid var(--border);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    font-family: 'Chivo Mono', monospace;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    padding: 16px 16px 8px;
}

.add-channel-row {
    display: flex;
    gap: 4px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-light);
}

.add-channel-input {
    flex: 1;
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 12px;
    padding: 6px 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    outline: none;
    transition: border-color 0.15s;
}

.add-channel-input:focus {
    border-color: var(--accent);
}

.add-channel-btn {
    width: 30px;
    height: 30px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: #fff;
    font-size: 16px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.12s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.add-channel-btn:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.add-channel-btn:disabled {
    opacity: 0.5;
    cursor: default;
}

.channel-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    cursor: pointer;
    border-left: 3px solid transparent;
    transition: all 0.12s ease;
}

.channel-item:hover {
    background: var(--bg-hover);
}

.channel-item.active {
    background: var(--accent-light);
    border-left-color: var(--accent);
}

.channel-thumb {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.channel-info {
    flex: 1;
    min-width: 0;
}

.channel-name {
    font-weight: 500;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.channel-subs {
    font-size: 11px;
    color: var(--text-muted);
}

.completion-badge {
    font-family: 'Chivo Mono', monospace;
    font-size: 10px;
    color: var(--text-muted);
    background: var(--bg);
    padding: 2px 6px;
    border-radius: 10px;
    white-space: nowrap;
}

.completion-badge.complete {
    background: var(--success);
    color: #fff;
}

.completion-badge.conflict {
    background: #ef4444;
    color: #fff;
}

/* === Detail Panel === */
.detail-panel {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

.detail-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    min-height: 100%;
}

.detail-left {
    padding: 24px 24px 24px 32px;
    border-right: 1px solid var(--border-light);
    overflow-y: auto;
    max-height: calc(100vh - 48px);
    position: sticky;
    top: 0;
}

.detail-right {
    padding: 24px 32px 24px 24px;
    overflow-y: auto;
    max-height: calc(100vh - 48px);
}

.empty-state {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    font-size: 15px;
}

/* --- Channel Header --- */
.detail-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.detail-thumb {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.detail-title {
    font-family: 'Chivo Mono', monospace;
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
}

.detail-desc {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
    line-height: 1.4;
    max-width: 600px;
}

/* --- Stats Row --- */
.stats-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.stat-chip {
    font-family: 'Chivo Mono', monospace;
    font-size: 11px;
    font-weight: 400;
    color: var(--text-muted);
    background: var(--bg);
    border: 1px solid var(--border-light);
    padding: 5px 12px;
    border-radius: 20px;
}

/* --- Videos Section --- */
.section-label {
    font-family: 'Chivo Mono', monospace;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    margin-bottom: 10px;
    text-transform: uppercase;
}

.video-list {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 8px;
    margin-bottom: 24px;
}

.video-card {
    flex-shrink: 0;
    width: 180px;
    text-decoration: none;
    color: var(--text);
    transition: transform 0.12s ease;
}

.video-card:hover {
    transform: translateY(-2px);
}

.video-card img {
    width: 180px;
    height: 101px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    display: block;
}

.video-card-title {
    font-size: 11px;
    font-weight: 500;
    margin-top: 6px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.video-card-meta {
    font-family: 'Chivo Mono', monospace;
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* --- Add Video --- */
.add-video-row {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
}

.add-video-input {
    flex: 1;
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 12px;
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: #fff;
    outline: none;
    transition: border-color 0.15s;
}

.add-video-input:focus {
    border-color: var(--accent);
}

.add-video-btn {
    font-family: 'Chivo Mono', monospace;
    font-size: 11px;
    font-weight: 600;
    padding: 6px 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.12s ease;
}

.add-video-btn:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

/* --- Category Groups --- */
.category-group {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
    transition: background 0.3s ease, border-color 0.3s ease;
}

.category-group.all-complete {
    background: rgba(59, 94, 255, 0.05);
    border-color: rgba(59, 94, 255, 0.2);
}

.group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.group-label {
    font-family: 'Chivo Mono', monospace;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.group-score {
    font-family: 'Chivo Mono', monospace;
    font-size: 12px;
    color: var(--text-muted);
    background: var(--bg);
    padding: 3px 10px;
    border-radius: 12px;
}

.group-score.has-score {
    color: var(--accent);
    background: var(--accent-light);
}

.subcategory {
    margin-bottom: 14px;
}

.subcategory:last-child {
    margin-bottom: 0;
}

.subcategory-label {
    font-family: 'Chivo Mono', monospace;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.options-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/* --- Option Buttons (the core interaction) --- */
.option-btn {
    position: relative;
    overflow: hidden;
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 12px;
    font-weight: 500;
    padding: 7px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: #fff;
    color: var(--text);
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
    -webkit-user-select: none;
}

.option-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-light);
}

.option-btn:active {
    transform: scale(0.97);
}

.score-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: 'Chivo Mono', monospace;
    font-size: 9px;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    background: var(--bg);
    color: var(--text-muted);
    margin-right: 4px;
}

.option-btn.selected .score-badge {
    background: rgba(255,255,255,0.25);
    color: #fff;
}

/* Other user's pick (not yours) */
.option-btn.other-pick {
    border-color: var(--accent);
    background: var(--accent-light);
}

/* Conflict: two users disagree */
.option-btn.conflict {
    border-color: #ef4444;
    background: #fef2f2;
}

.option-btn.selected.conflict {
    background: #ef4444;
    border-color: #ef4444;
    color: #fff;
}

/* Verified: both users agree */
.option-btn.verified {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.verified-badge {
    font-size: 10px;
    margin-left: 4px;
    opacity: 0.9;
}

.user-initials {
    font-family: 'Chivo Mono', monospace;
    font-size: 8px;
    font-weight: 700;
    background: var(--accent);
    color: #fff;
    padding: 1px 4px;
    border-radius: 3px;
    margin-left: 4px;
}

.option-btn.conflict .user-initials {
    background: #ef4444;
}

.user-initials.mine {
    background: rgba(255,255,255,0.3);
}

/* AI suggestion (yellow pre-selection) */
.option-btn.ai-suggestion {
    border-color: #f59e0b;
    background: #fef9e7;
    color: #92400e;
}

.option-btn.ai-suggestion:hover {
    background: #fef3c7;
    border-color: #d97706;
}

.ai-badge {
    font-family: 'Chivo Mono', monospace;
    font-size: 8px;
    font-weight: 700;
    background: #f59e0b;
    color: #fff;
    padding: 1px 4px;
    border-radius: 3px;
    margin-left: 4px;
}

.ai-reasoning-row {
    display: flex;
    gap: 6px;
    align-items: flex-start;
    margin-top: 6px;
}

.ai-author {
    background: #f59e0b !important;
    flex-shrink: 0;
    margin-top: 4px;
}

.ai-reasoning {
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 11px;
    color: #92400e;
    background: #fffbeb;
    padding: 4px 8px;
    border-radius: 4px;
    flex: 1;
}

.ai-selection {
    font-weight: 600;
    text-decoration: underline;
    text-decoration-color: #f59e0b;
    text-underline-offset: 2px;
}


.ai-collapsible {
    margin-top: 8px;
}

.ai-collapsible-toggle {
    font-family: 'Chivo Mono', monospace;
    font-size: 9px;
    font-weight: 600;
    color: #f59e0b;
    cursor: pointer;
    padding: 2px 0;
    user-select: none;
    list-style: none;
}

.ai-collapsible-toggle::-webkit-details-marker {
    display: none;
}

.ai-collapsible-toggle::before {
    content: '▶ ';
    font-size: 8px;
}

.ai-collapsible[open] .ai-collapsible-toggle::before {
    content: '▼ ';
}

.ai-collapsible[open] .ai-reasoning-row {
    margin-top: 6px;
}

/* Override states */
.option-btn.overridden {
    background: var(--success);
    border-color: var(--success);
    color: #fff;
}

.option-btn.overridden-out {
    opacity: 0.4;
    border-style: dashed;
    text-decoration: line-through;
}

.override-badge {
    font-family: 'Chivo Mono', monospace;
    font-size: 8px;
    font-weight: 700;
    background: rgba(255,255,255,0.3);
    padding: 1px 4px;
    border-radius: 3px;
    margin-left: 4px;
}

.overridden-out-badge {
    background: #999 !important;
}

.override-btn {
    font-family: 'Chivo Mono', monospace;
    font-size: 9px;
    font-weight: 600;
    padding: 3px 10px;
    margin-top: 4px;
    background: #fef2f2;
    border: 1px solid #ef4444;
    border-radius: 4px;
    color: #ef4444;
    cursor: pointer;
    transition: all 0.15s;
}

.override-btn:hover {
    background: #ef4444;
    color: #fff;
}

.undo-override-btn {
    font-family: 'Chivo Mono', monospace;
    font-size: 9px;
    font-weight: 600;
    padding: 3px 10px;
    margin-top: 4px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s;
}

.undo-override-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* User badge in header */
.user-badge {
    margin-left: auto;
    font-family: 'Chivo Mono', monospace;
    font-size: 11px;
    font-weight: 700;
    background: var(--accent);
    color: #fff;
    padding: 3px 8px;
    border-radius: 10px;
    cursor: pointer;
    transition: opacity 0.15s;
}

.user-badge:hover {
    opacity: 0.8;
}

.option-btn.selected {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    animation: btn-flash 0.3s ease;
}

@keyframes btn-flash {
    0%   { background: var(--accent); color: #fff; }
    35%  { background: #fff; color: var(--accent); }
    100% { background: var(--accent); color: #fff; }
}

/* Ripple effect */
.option-btn .ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(59, 94, 255, 0.25);
    transform: scale(0);
    animation: ripple-expand 0.45s ease-out forwards;
    pointer-events: none;
    width: 20px;
    height: 20px;
    margin-left: -10px;
    margin-top: -10px;
}

@keyframes ripple-expand {
    to {
        transform: scale(3);
        opacity: 0;
    }
}

/* --- Dropdown Select --- */
.option-select {
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 13px;
    font-weight: 500;
    padding: 6px 10px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: #fff;
    color: var(--text);
    outline: none;
    cursor: pointer;
    min-width: 200px;
    transition: border-color 0.15s;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M3 5l3 3 3-3' fill='none' stroke='%236b6b7b' stroke-width='1.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    padding-right: 28px;
}

.option-select:focus {
    border-color: var(--accent);
}

.option-select:hover {
    border-color: var(--accent);
}

/* --- Group Notes --- */
.note-input-row {
    display: flex;
    gap: 6px;
    align-items: flex-start;
    margin-top: 10px;
}

.note-author-badge {
    font-family: 'Chivo Mono', monospace;
    font-size: 9px;
    font-weight: 700;
    background: var(--accent);
    color: #fff;
    padding: 2px 6px;
    border-radius: 3px;
    margin-top: 6px;
    flex-shrink: 0;
}

.group-note {
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 12px;
    flex: 1;
    min-height: 32px;
    padding: 6px 10px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    background: var(--bg);
    outline: none;
    resize: vertical;
    transition: border-color 0.15s;
    color: var(--text);
}

.group-note:focus {
    border-color: var(--accent);
}

.other-note-row {
    margin-top: 6px;
}

.other-author {
    background: #888 !important;
}

.other-note-text {
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 12px;
    color: var(--text-muted);
    background: #f8f8f8;
    border-radius: var(--radius-sm);
    padding: 6px 10px;
    flex: 1;
}

.other-note-text.empty {
    color: #c0c0c0;
    font-style: italic;
}

/* --- Takes Section --- */
.takes-section {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.take-field {
    flex: 1;
}

.take-label {
    font-family: 'Chivo Mono', monospace;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 4px;
    text-transform: uppercase;
}

.take-textarea {
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 12px;
    width: 100%;
    min-height: 48px;
    padding: 8px 10px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: #fff;
    outline: none;
    resize: vertical;
    transition: border-color 0.15s;
    color: var(--text);
}

.take-textarea:focus {
    border-color: var(--accent);
}

.take-readonly {
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 12px;
    padding: 8px 10px;
    background: #f8f8f8;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    min-height: 48px;
}

.ai-take-label {
    color: #f59e0b !important;
}

.take-readonly.ai-take {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
}

.take-field.ai-take-field {
    margin-bottom: 12px;
}

/* --- AI Tabs --- */
.ai-tabs-container {
    margin-bottom: 12px;
}

.ai-tabs-bar {
    display: flex;
    gap: 4px;
    margin-bottom: 8px;
}

.ai-tab {
    font-family: 'Chivo Mono', monospace;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.5px;
    padding: 5px 10px;
    border: 1.5px solid #fde68a;
    border-radius: 4px;
    background: #fffbeb;
    color: #92400e;
    cursor: pointer;
    transition: all 0.15s;
}

.ai-tab:hover {
    background: #fef3c7;
    border-color: #f59e0b;
}

.ai-tab.active {
    background: #f59e0b;
    border-color: #f59e0b;
    color: #fff;
}

.ai-tab-content {
    display: none;
}

.ai-tab-content.active {
    display: block;
}

.sentiment-analysis {
    font-size: 11px;
    line-height: 1.6;
    white-space: pre-wrap;
}

.take-user-tabs-bar {
    display: flex;
    gap: 4px;
    margin-bottom: 8px;
}

.take-user-tab {
    font-family: 'Chivo Mono', monospace;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.5px;
    padding: 5px 10px;
    border: 1.5px solid var(--border);
    border-radius: 4px;
    background: #fff;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s;
}

.take-user-tab:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.take-user-tab.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.take-user-content {
    display: none;
}

.take-user-content.active {
    display: block;
}

.take-readonly.empty {
    color: #c0c0c0;
    font-style: italic;
}

/* --- Free Text Input (for "Other") --- */
.free-text-input {
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 12px;
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: #fff;
    outline: none;
    width: 160px;
    margin-left: 6px;
    transition: border-color 0.15s;
}

.free-text-input:focus {
    border-color: var(--accent);
}

/* --- Channel Link --- */
.channel-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-family: 'Chivo Mono', monospace;
    font-size: 11px;
    font-weight: 600;
    color: var(--accent);
    text-decoration: none;
    margin-bottom: 12px;
    transition: opacity 0.12s;
}

.channel-link:hover {
    opacity: 0.7;
}

.channel-link svg {
    width: 14px;
    height: 14px;
}

/* --- Player --- */
.player-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 */
    background: #000;
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 16px;
}

.player-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.player-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-family: 'Chivo Mono', monospace;
    font-size: 12px;
}

.videos-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.videos-header .section-label {
    margin-bottom: 0;
}

.classify-btn {
    font-family: 'Chivo Mono', monospace;
    font-size: 9px;
    font-weight: 600;
    padding: 3px 8px;
    background: var(--accent-light);
    border: 1px solid var(--accent);
    border-radius: 10px;
    color: var(--accent);
    cursor: pointer;
    transition: all 0.12s ease;
}

.classify-btn:hover {
    background: var(--accent);
    color: #fff;
}

.classify-btn:disabled {
    opacity: 0.6;
    cursor: default;
}

.classify-status {
    font-family: 'Chivo Mono', monospace;
    font-size: 9px;
    color: var(--text-muted);
}

/* --- Video list (vertical in left panel) --- */
.video-list-vertical {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.video-row {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 6px 8px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.12s;
    text-decoration: none;
    color: var(--text);
}

.video-row:hover {
    background: var(--bg-hover);
}

.video-row.playing {
    background: var(--accent-light);
    border-left: 2px solid var(--accent);
}

.video-row img {
    width: 100px;
    height: 56px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}

.video-row-info {
    flex: 1;
    min-width: 0;
}

.video-row-title {
    font-size: 12px;
    font-weight: 500;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.video-row-meta {
    font-family: 'Chivo Mono', monospace;
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 2px;
}

.watched-badges {
    display: flex;
    align-items: center;
    gap: 3px;
    flex-shrink: 0;
    margin-left: auto;
}

.watched-label {
    font-family: 'Chivo Mono', monospace;
    font-size: 8px;
    color: var(--text-muted);
    margin-right: 2px;
}

.watched-btn {
    font-family: 'Chivo Mono', monospace;
    font-size: 9px;
    font-weight: 700;
    width: 24px;
    height: 20px;
    border: 1.5px solid var(--border);
    border-radius: 4px;
    background: #fff;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s;
    padding: 0;
    line-height: 20px;
    text-align: center;
}

.watched-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.watched-btn.checked {
    background: var(--success);
    border-color: var(--success);
    color: #fff;
}

/* --- Screenshot Grid --- */
.screenshot-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 24px;
}

.screenshot-slot {
    position: relative;
    border: 1.5px dashed var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    aspect-ratio: 16 / 9;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    transition: border-color 0.15s;
}

.screenshot-slot:hover {
    border-color: var(--accent);
}

.screenshot-slot.drag-over {
    border-color: var(--accent);
    background: var(--accent-light);
}

.screenshot-slot.has-image {
    border-style: solid;
    border-color: var(--border-light);
}

.screenshot-slot img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.screenshot-btn {
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 10px;
    font-weight: 500;
    color: var(--text-muted);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    text-align: center;
    line-height: 1.3;
    transition: color 0.12s;
}

.screenshot-btn:hover {
    color: var(--accent);
}

.screenshot-clear {
    position: absolute;
    top: 3px;
    right: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(0,0,0,0.6);
    color: #fff;
    border: none;
    font-size: 14px;
    line-height: 20px;
    text-align: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s;
}

.screenshot-slot:hover .screenshot-clear {
    opacity: 1;
}

.screenshot-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    font-family: 'Chivo Mono', monospace;
    font-size: 8px;
    font-weight: 600;
    text-align: center;
    padding: 2px 4px;
    background: rgba(0,0,0,0.5);
    color: #fff;
    letter-spacing: 0.3px;
    opacity: 0;
    transition: opacity 0.15s;
}

.screenshot-slot.has-image .screenshot-label {
    opacity: 1;
}

.screenshot-slot:hover .screenshot-label {
    opacity: 1;
}

/* --- Mobile Detail Tabs --- */
.mobile-tabs {
    display: none; /* hidden on desktop */
}

.mobile-tab-content {
    display: block;
}

#tab-scoring {
    display: none; /* on desktop, scoring is in detail-right */
}

.mobile-tab {
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    padding: 8px 16px;
    border: none;
    background: none;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.15s;
}

.mobile-tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.mobile-tab:hover {
    color: var(--accent);
}

/* --- Comment System --- */
.comments-section {
    margin-top: 12px;
}

.comment-thread {
    margin-bottom: 8px;
}

.comment-item {
    display: flex;
    gap: 8px;
    padding: 6px 0;
}

.comment-item.reply {
    margin-left: 28px;
    padding-left: 10px;
    border-left: 2px solid var(--border-light);
}

.comment-author {
    font-family: 'Chivo Mono', monospace;
    font-size: 9px;
    font-weight: 700;
    background: var(--accent);
    color: #fff;
    padding: 2px 6px;
    border-radius: 3px;
    flex-shrink: 0;
    height: 18px;
    line-height: 14px;
    margin-top: 2px;
}

.comment-body {
    flex: 1;
    min-width: 0;
}

.comment-text {
    font-size: 12px;
    line-height: 1.5;
    color: var(--text);
}

.comment-meta {
    font-family: 'Chivo Mono', monospace;
    font-size: 8px;
    color: var(--text-muted);
    margin-top: 2px;
}

.comment-reply-btn {
    font-family: 'Chivo Mono', monospace;
    font-size: 8px;
    color: var(--accent);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    margin-left: 8px;
}

.comment-reply-btn:hover {
    text-decoration: underline;
}

.comment-input-row {
    display: flex;
    gap: 6px;
    margin-top: 8px;
}

.comment-user-select {
    font-family: 'Chivo Mono', monospace;
    font-size: 10px;
    font-weight: 700;
    padding: 4px 6px;
    border: 1.5px solid var(--accent);
    border-radius: 4px;
    background: var(--accent);
    color: #fff;
    cursor: pointer;
    flex-shrink: 0;
    height: 28px;
}

.comment-textarea {
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 12px;
    flex: 1;
    min-height: 28px;
    padding: 4px 8px;
    border: 1px solid var(--border);
    border-radius: 6px;
    outline: none;
    resize: vertical;
    transition: border-color 0.15s;
}

.comment-textarea:focus {
    border-color: var(--accent);
}

.comment-post-btn {
    font-family: 'Chivo Mono', monospace;
    font-size: 10px;
    font-weight: 600;
    padding: 4px 12px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    flex-shrink: 0;
    height: 28px;
    transition: opacity 0.12s;
}

.comment-post-btn:hover {
    opacity: 0.9;
}

/* === Scrollbar === */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #aaa; }

/* === Mobile === */
@media (max-width: 768px) {
    /* Stack sidebar on top as horizontal scroll */
    .app-layout {
        flex-direction: column;
        height: auto;
    }

    .sidebar {
        width: 100%;
        min-width: 100%;
        max-height: none;
        border-right: none;
        border-bottom: 1px solid var(--border);
        flex-shrink: 0;
    }

    .sidebar-header {
        display: none;
    }

    #channel-items {
        display: flex;
        overflow-x: auto;
        gap: 0;
        -webkit-overflow-scrolling: touch;
    }

    .channel-item {
        flex-shrink: 0;
        flex-direction: column;
        align-items: center;
        gap: 4px;
        padding: 8px 12px;
        border-left: none;
        border-bottom: 3px solid transparent;
        min-width: 80px;
        text-align: center;
    }

    .channel-item.active {
        border-left: none;
        border-bottom-color: var(--accent);
    }

    .channel-info {
        text-align: center;
    }

    .channel-name {
        font-size: 10px;
    }

    .channel-subs {
        display: none;
    }

    .add-channel-row {
        display: none;
    }

    /* Detail panel: full width, single column */
    .detail-panel {
        flex: none;
        overflow-y: visible;
    }

    .detail-layout {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .detail-left {
        border-right: none;
        padding: 16px;
        max-height: none;
        position: static;
    }

    .detail-right {
        display: none; /* scoring is in the mobile tab instead */
    }

    .mobile-tabs {
        display: flex;
        border-bottom: 1px solid var(--border);
        margin-bottom: 12px;
    }

    #tab-scoring {
        display: block; /* override desktop hide */
    }

    .mobile-tab-content.hidden {
        display: none !important;
    }

    .detail-header {
        gap: 10px;
        margin-bottom: 10px;
    }

    .detail-thumb {
        width: 32px;
        height: 32px;
    }

    .detail-title {
        font-size: 14px;
    }

    .detail-desc {
        display: none;
    }

    .stats-row {
        gap: 4px;
        margin-bottom: 12px;
    }

    .stat-chip {
        font-size: 9px;
        padding: 3px 6px;
    }

    /* Player: full width */
    .player-container {
        margin-bottom: 12px;
    }

    /* Takes: stack vertically */
    .takes-section {
        flex-direction: column;
        gap: 8px;
    }

    /* Videos: smaller thumbs */
    .video-row img {
        width: 80px;
        height: 45px;
    }

    .video-row-title {
        font-size: 11px;
    }

    /* Scoring: tighter */
    .category-group {
        padding: 14px;
        margin-bottom: 10px;
    }

    .group-label {
        font-size: 11px;
    }

    .subcategory-label {
        font-size: 9px;
    }

    .option-btn {
        font-size: 11px;
        padding: 6px 10px;
    }

    .options-row {
        gap: 4px;
    }

    .score-badge {
        font-size: 8px;
        min-width: 14px;
        height: 14px;
    }

    /* Header */
    .top-bar {
        height: 40px;
        padding: 0 12px;
    }

    .logo {
        font-size: 12px;
    }

    .header-tabs {
        gap: 2px;
    }

    .header-tab {
        font-size: 9px;
        padding: 4px 8px;
    }

    .user-badge {
        font-size: 9px;
        padding: 2px 6px;
    }
}
