:root {
    --bg-main: #0e1218; --bg-card: #151c27; --bg-hover: #1f293a;
    --accent: #1AEBFF; --text-main: #e9eef5; --text-muted: #8899a6;
    --panel-width: 350px;
}

body { background: var(--bg-main); color: var(--text-main); font-family: 'Segoe UI', Tahoma, sans-serif; margin: 0; display: flex; height: 100vh; overflow: hidden; }
#app-container { display: flex; width: 100%; height: 100%; }

#channel-section { background: var(--bg-card); border-right: 2px solid #1a2333; display: flex; flex-direction: column; z-index: 10; }
.header { padding: 15px 20px; background: #1a2333; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid rgba(255,255,255,0.05); }
.header h2 { margin: 0; font-size: 18px; color: var(--text-main); }

.zap-input { width: 50px; padding: 6px; border-radius: 6px; border: 1px solid rgba(255,255,255,0.2); background: var(--bg-main); color: white; text-align: center; outline: none; font-size: 16px; font-weight: bold; }
.zap-input:focus { border-color: var(--accent); }

.zap-btn { background: #4caf50; color: white; border: none; padding: 6px 12px; border-radius: 6px; font-weight: bold; cursor: pointer; font-size: 14px; transition: 0.2s; display: flex; align-items: center; justify-content: center; }
.zap-btn:hover { background: #388e3c; }
.zap-btn:active { transform: scale(0.95); }

#channel-list { flex: 1; overflow-y: auto; padding: 10px; }

.chan-item { margin-bottom: 8px; background: var(--bg-main); border-radius: 6px; cursor: pointer; font-weight: bold; transition: 0.2s; display: flex; align-items: center; border: 4px solid transparent;}
.chan-item:hover { background: var(--bg-hover); }
.chan-item.active { border-color: var(--accent); }

.chan-logo { max-height: 35px; max-width: 130px; object-fit: contain; }

#video-section { flex: 1; display: flex; flex-direction: column; background: #000; }
.view-panel { flex: 1; display: flex; flex-direction: column; }

/* --- MODE MOBILE --- */
@media (max-width: 992px) {
    body { overflow: auto; }
    #app-container { flex-direction: column; height: auto; }
    #video-section { order: 1; width: 100%; height: auto; position: sticky; top: 0; z-index: 20; box-shadow: 0 4px 15px rgba(0,0,0,0.6); }
    .view-panel { aspect-ratio: 16/9; height: auto; }
    #channel-section { order: 2; width: 100%; border-right: none; border-top: 2px solid #1a2333; height: auto; flex: none; }
    #channel-list { overflow-y: visible; padding: 15px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
    .chan-item { padding: 10px; margin-bottom: 0; flex-direction: column; justify-content: center; gap: 8px; height: 80px; text-align: center; border: 4px solid transparent; }
    .chan-item.active { border-color: var(--accent); border-bottom: 4px solid var(--accent); }
    .chan-logo { max-width: 100%; height: 30px; }
}

/* --- MODE BUREAU --- */
@media (min-width: 993px) {
    #channel-section { width: var(--panel-width); height: 100%; }
    #channel-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 15px; }
    .chan-item { flex-direction: column; justify-content: center; gap: 10px; height: 90px; margin-bottom: 0; padding: 10px; }
    .chan-logo { max-width: 100%; max-height: 40px; } 
}